mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Merge branch 'master' into navigation
This commit is contained in:
commit
2933e6765c
2
examples/.gitignore
vendored
2
examples/.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
## Visual Studio files
|
build/*
|
||||||
Debug/*
|
Debug/*
|
||||||
Release/*
|
Release/*
|
||||||
ipch/*
|
ipch/*
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include <stdint.h> // uint64_t
|
#include <stdint.h> // uint64_t
|
||||||
#include <cstring> // memcpy
|
#include <cstring> // memcpy
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_a5.h"
|
#include "imgui_impl_a5.h"
|
||||||
#include <allegro5/allegro.h>
|
#include <allegro5/allegro.h>
|
||||||
#include <allegro5/allegro_primitives.h>
|
#include <allegro5/allegro_primitives.h>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <allegro5/allegro.h>
|
#include <allegro5/allegro.h>
|
||||||
#include <allegro5/allegro_primitives.h>
|
#include <allegro5/allegro_primitives.h>
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_a5.h"
|
#include "imgui_impl_a5.h"
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
1A1A0F331CB3A0E10090F036 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 197E1E881B89443600E3FE6A /* imgui_demo.cpp */; };
|
1A1A0F331CB3A0E10090F036 /* imgui_demo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 197E1E881B89443600E3FE6A /* imgui_demo.cpp */; };
|
||||||
1A1A0F341CB3A0EC0090F036 /* debug_hud.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC5891B2E6A5500C130BA /* debug_hud.cpp */; };
|
1A1A0F341CB3A0EC0090F036 /* debug_hud.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC5891B2E6A5500C130BA /* debug_hud.cpp */; };
|
||||||
1A1A0F481CB3A2E50090F036 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1A0F391CB3A1B20090F036 /* main.cpp */; };
|
1A1A0F481CB3A2E50090F036 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1A0F391CB3A1B20090F036 /* main.cpp */; };
|
||||||
1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw.cpp */; };
|
1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw_gl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */; };
|
||||||
1A1A0F4E1CB3C54D0090F036 /* libglfw3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */; };
|
1A1A0F4E1CB3C54D0090F036 /* libglfw.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */; };
|
||||||
6D1E39171B35EEF10017B40F /* uSynergy.c in Sources */ = {isa = PBXBuildFile; fileRef = 6D1E39151B35EEF10017B40F /* uSynergy.c */; };
|
6D1E39171B35EEF10017B40F /* uSynergy.c in Sources */ = {isa = PBXBuildFile; fileRef = 6D1E39151B35EEF10017B40F /* uSynergy.c */; };
|
||||||
6D2FC55A1B2E632000C130BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC5591B2E632000C130BA /* main.m */; };
|
6D2FC55A1B2E632000C130BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC5591B2E632000C130BA /* main.m */; };
|
||||||
6D2FC55D1B2E632000C130BA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC55C1B2E632000C130BA /* AppDelegate.m */; };
|
6D2FC55D1B2E632000C130BA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC55C1B2E632000C130BA /* AppDelegate.m */; };
|
||||||
@ -43,10 +43,10 @@
|
|||||||
1A1A0F221CB39FB50090F036 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
1A1A0F221CB39FB50090F036 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||||
1A1A0F271CB39FB50090F036 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
1A1A0F271CB39FB50090F036 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
1A1A0F2C1CB39FB50090F036 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
1A1A0F2C1CB39FB50090F036 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imgui_impl_glfw.cpp; sourceTree = "<group>"; };
|
1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imgui_impl_glfw_gl2.cpp; sourceTree = "<group>"; };
|
||||||
1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imgui_impl_glfw.h; sourceTree = "<group>"; };
|
1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw_gl2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imgui_impl_glfw_gl2.h; sourceTree = "<group>"; };
|
||||||
1A1A0F391CB3A1B20090F036 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
1A1A0F391CB3A1B20090F036 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||||
1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libglfw3.dylib; path = /usr/local/lib/libglfw3.dylib; sourceTree = "<absolute>"; };
|
1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libglfw.dylib; path = /usr/local/lib/libglfw.dylib; sourceTree = "<absolute>"; };
|
||||||
6D1E39151B35EEF10017B40F /* uSynergy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uSynergy.c; sourceTree = "<group>"; };
|
6D1E39151B35EEF10017B40F /* uSynergy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uSynergy.c; sourceTree = "<group>"; };
|
||||||
6D1E39161B35EEF10017B40F /* uSynergy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uSynergy.h; sourceTree = "<group>"; };
|
6D1E39161B35EEF10017B40F /* uSynergy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uSynergy.h; sourceTree = "<group>"; };
|
||||||
6D2FC5541B2E632000C130BA /* imguiex-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "imguiex-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
6D2FC5541B2E632000C130BA /* imguiex-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "imguiex-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@ -77,7 +77,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
1A1A0F4E1CB3C54D0090F036 /* libglfw3.dylib in Frameworks */,
|
1A1A0F4E1CB3C54D0090F036 /* libglfw.dylib in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -96,7 +96,7 @@
|
|||||||
1A1A0F201CB39FB50090F036 /* imguiex-osx */ = {
|
1A1A0F201CB39FB50090F036 /* imguiex-osx */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */,
|
1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */,
|
||||||
1A1A0F351CB3A1B20090F036 /* opengl2_example */,
|
1A1A0F351CB3A1B20090F036 /* opengl2_example */,
|
||||||
1A1A0F211CB39FB50090F036 /* AppDelegate.h */,
|
1A1A0F211CB39FB50090F036 /* AppDelegate.h */,
|
||||||
1A1A0F221CB39FB50090F036 /* AppDelegate.m */,
|
1A1A0F221CB39FB50090F036 /* AppDelegate.m */,
|
||||||
@ -117,8 +117,8 @@
|
|||||||
1A1A0F351CB3A1B20090F036 /* opengl2_example */ = {
|
1A1A0F351CB3A1B20090F036 /* opengl2_example */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw.cpp */,
|
1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */,
|
||||||
1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw.h */,
|
1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw_gl2.h */,
|
||||||
1A1A0F391CB3A1B20090F036 /* main.cpp */,
|
1A1A0F391CB3A1B20090F036 /* main.cpp */,
|
||||||
);
|
);
|
||||||
name = opengl2_example;
|
name = opengl2_example;
|
||||||
@ -307,7 +307,7 @@
|
|||||||
1A1A0F481CB3A2E50090F036 /* main.cpp in Sources */,
|
1A1A0F481CB3A2E50090F036 /* main.cpp in Sources */,
|
||||||
1A1A0F321CB3A0DE0090F036 /* uSynergy.c in Sources */,
|
1A1A0F321CB3A0DE0090F036 /* uSynergy.c in Sources */,
|
||||||
1A1A0F231CB39FB50090F036 /* AppDelegate.m in Sources */,
|
1A1A0F231CB39FB50090F036 /* AppDelegate.m in Sources */,
|
||||||
1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw.cpp in Sources */,
|
1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw_gl2.cpp in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ImGui - standalone example application for DirectX 10
|
// ImGui - standalone example application for DirectX 10
|
||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_dx10.h"
|
#include "imgui_impl_dx10.h"
|
||||||
#include <d3d10_1.h>
|
#include <d3d10_1.h>
|
||||||
#include <d3d10.h>
|
#include <d3d10.h>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
// https://github.com/ocornut/imgui
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_dx11.h"
|
#include "imgui_impl_dx11.h"
|
||||||
|
|
||||||
// DirectX
|
// DirectX
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ImGui - standalone example application for DirectX 11
|
// ImGui - standalone example application for DirectX 11
|
||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_dx11.h"
|
#include "imgui_impl_dx11.h"
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#define DIRECTINPUT_VERSION 0x0800
|
#define DIRECTINPUT_VERSION 0x0800
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
// https://github.com/ocornut/imgui
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_dx9.h"
|
#include "imgui_impl_dx9.h"
|
||||||
|
|
||||||
// DirectX
|
// DirectX
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ImGui - standalone example application for DirectX 9
|
// ImGui - standalone example application for DirectX 9
|
||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_dx9.h"
|
#include "imgui_impl_dx9.h"
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
#define DIRECTINPUT_VERSION 0x0800
|
#define DIRECTINPUT_VERSION 0x0800
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// Copyright (C) 2015 by Giovanni Zito
|
// Copyright (C) 2015 by Giovanni Zito
|
||||||
// This file is part of ImGui
|
// This file is part of ImGui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_marmalade.h"
|
#include "imgui_impl_marmalade.h"
|
||||||
|
|
||||||
#include <s3eClipboard.h>
|
#include <s3eClipboard.h>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Copyright (C) 2015 by Giovanni Zito
|
// Copyright (C) 2015 by Giovanni Zito
|
||||||
// This file is part of ImGui
|
// This file is part of ImGui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_marmalade.h"
|
#include "imgui_impl_marmalade.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// ImGui - null/dummy example application (compile and link imgui with no inputs, no outputs)
|
// ImGui - null/dummy example application (compile and link imgui with no inputs, no outputs)
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
|
@ -2,13 +2,17 @@
|
|||||||
# Cross Platform Makefile
|
# Cross Platform Makefile
|
||||||
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
||||||
#
|
#
|
||||||
#
|
# You will need GLFW (http://www.glfw.org):
|
||||||
# if you using Mac OS X:
|
# Linux:
|
||||||
# You'll need glfw
|
# apt-get install libglfw-dev
|
||||||
# http://www.glfw.org
|
# Mac OS X:
|
||||||
|
# brew install glfw
|
||||||
|
# MSYS2:
|
||||||
|
# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw
|
||||||
#
|
#
|
||||||
|
|
||||||
#CXX = g++
|
#CXX = g++
|
||||||
|
#CXX = clang++
|
||||||
|
|
||||||
EXE = opengl2_example
|
EXE = opengl2_example
|
||||||
OBJS = main.o imgui_impl_glfw_gl2.o
|
OBJS = main.o imgui_impl_glfw_gl2.o
|
||||||
@ -46,6 +50,7 @@ ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
|
|||||||
CFLAGS = $(CXXFLAGS)
|
CFLAGS = $(CXXFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
// https://github.com/ocornut/imgui
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_glfw_gl2.h"
|
#include "imgui_impl_glfw_gl2.h"
|
||||||
|
|
||||||
// GLFW
|
// GLFW
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// **Prefer using the code in the opengl3_example/ folder**
|
// **Prefer using the code in the opengl3_example/ folder**
|
||||||
// See imgui_impl_glfw.cpp for details.
|
// See imgui_impl_glfw.cpp for details.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_glfw_gl2.h"
|
#include "imgui_impl_glfw_gl2.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
@ -2,15 +2,17 @@
|
|||||||
# Cross Platform Makefile
|
# Cross Platform Makefile
|
||||||
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
||||||
#
|
#
|
||||||
#
|
# You will need GLFW (http://www.glfw.org):
|
||||||
# You will need GLFW (http://www.glfw.org)
|
# Linux:
|
||||||
#
|
# apt-get install libglfw-dev
|
||||||
# apt-get install libglfw-dev # Linux
|
# Mac OS X:
|
||||||
# brew install glfw # Mac OS X
|
# brew install glfw
|
||||||
# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw # MSYS2
|
# MSYS2:
|
||||||
|
# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw
|
||||||
#
|
#
|
||||||
|
|
||||||
#CXX = g++
|
#CXX = g++
|
||||||
|
#CXX = clang++
|
||||||
|
|
||||||
EXE = opengl3_example
|
EXE = opengl3_example
|
||||||
OBJS = main.o imgui_impl_glfw_gl3.o
|
OBJS = main.o imgui_impl_glfw_gl3.o
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
// https://github.com/ocornut/imgui
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_glfw_gl3.h"
|
#include "imgui_impl_glfw_gl3.h"
|
||||||
|
|
||||||
// GL3W/GLFW
|
// GL3W/GLFW
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
// (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
||||||
// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.)
|
// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.)
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_glfw_gl3.h"
|
#include "imgui_impl_glfw_gl3.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
|
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdl_gl2.h"
|
#include "imgui_impl_sdl_gl2.h"
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// **Prefer using the code in the sdl_opengl3_example/ folder**
|
// **Prefer using the code in the sdl_opengl3_example/ folder**
|
||||||
// See imgui_impl_sdl.cpp for details.
|
// See imgui_impl_sdl.cpp for details.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdl_gl2.h"
|
#include "imgui_impl_sdl_gl2.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
@ -2,15 +2,17 @@
|
|||||||
# Cross Platform Makefile
|
# Cross Platform Makefile
|
||||||
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
|
||||||
#
|
#
|
||||||
#
|
# You will need SDL2 (http://www.libsdl.org):
|
||||||
# You will need SDL2 (http://www.libsdl.org)
|
# Linux:
|
||||||
#
|
# apt-get install libsdl2-dev
|
||||||
# apt-get install libsdl2-dev # Linux
|
# Mac OS X:
|
||||||
# brew install sdl2 # Mac OS X
|
# brew install sdl2
|
||||||
# pacman -S mingw-w64-i686-SDL # MSYS2
|
# MSYS2:
|
||||||
|
# pacman -S mingw-w64-i686-SDL
|
||||||
#
|
#
|
||||||
|
|
||||||
#CXX = g++
|
#CXX = g++
|
||||||
|
#CXX = clang++
|
||||||
|
|
||||||
EXE = sdl_opengl3_example
|
EXE = sdl_opengl3_example
|
||||||
OBJS = main.o imgui_impl_sdl_gl3.o
|
OBJS = main.o imgui_impl_sdl_gl3.o
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
// (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
|
||||||
// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.)
|
// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.)
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdl_gl3.h"
|
#include "imgui_impl_sdl_gl3.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
|
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
// https://github.com/ocornut/imgui
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
|
#include "imgui_impl_glfw_vulkan.h"
|
||||||
|
|
||||||
// GLFW
|
// GLFW
|
||||||
#define GLFW_INCLUDE_NONE
|
#define GLFW_INCLUDE_NONE
|
||||||
@ -19,8 +20,6 @@
|
|||||||
#include <GLFW/glfw3native.h>
|
#include <GLFW/glfw3native.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "imgui_impl_glfw_vulkan.h"
|
|
||||||
|
|
||||||
// GLFW Data
|
// GLFW Data
|
||||||
static GLFWwindow* g_Window = NULL;
|
static GLFWwindow* g_Window = NULL;
|
||||||
static double g_Time = 0.0f;
|
static double g_Time = 0.0f;
|
||||||
@ -36,7 +35,7 @@ static VkDescriptorPool g_DescriptorPool = VK_NULL_HANDLE;
|
|||||||
static void (*g_CheckVkResult)(VkResult err) = NULL;
|
static void (*g_CheckVkResult)(VkResult err) = NULL;
|
||||||
|
|
||||||
static VkCommandBuffer g_CommandBuffer = VK_NULL_HANDLE;
|
static VkCommandBuffer g_CommandBuffer = VK_NULL_HANDLE;
|
||||||
static size_t g_BufferMemoryAlignment = 256;
|
static VkDeviceSize g_BufferMemoryAlignment = 256;
|
||||||
static VkPipelineCreateFlags g_PipelineCreateFlags = 0;
|
static VkPipelineCreateFlags g_PipelineCreateFlags = 0;
|
||||||
static int g_FrameIndex = 0;
|
static int g_FrameIndex = 0;
|
||||||
|
|
||||||
@ -52,8 +51,8 @@ static VkImageView g_FontView = VK_NULL_HANDLE;
|
|||||||
|
|
||||||
static VkDeviceMemory g_VertexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkDeviceMemory g_VertexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
static VkDeviceMemory g_IndexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkDeviceMemory g_IndexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
static size_t g_VertexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkDeviceSize g_VertexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
static size_t g_IndexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkDeviceSize g_IndexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
static VkBuffer g_VertexBuffer[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkBuffer g_VertexBuffer[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
static VkBuffer g_IndexBuffer[IMGUI_VK_QUEUED_FRAMES] = {};
|
static VkBuffer g_IndexBuffer[IMGUI_VK_QUEUED_FRAMES] = {};
|
||||||
|
|
||||||
@ -164,7 +163,7 @@ void ImGui_ImplGlfwVulkan_RenderDrawLists(ImDrawData* draw_data)
|
|||||||
vkDestroyBuffer(g_Device, g_VertexBuffer[g_FrameIndex], g_Allocator);
|
vkDestroyBuffer(g_Device, g_VertexBuffer[g_FrameIndex], g_Allocator);
|
||||||
if (g_VertexBufferMemory[g_FrameIndex])
|
if (g_VertexBufferMemory[g_FrameIndex])
|
||||||
vkFreeMemory(g_Device, g_VertexBufferMemory[g_FrameIndex], g_Allocator);
|
vkFreeMemory(g_Device, g_VertexBufferMemory[g_FrameIndex], g_Allocator);
|
||||||
size_t vertex_buffer_size = ((vertex_size-1) / g_BufferMemoryAlignment+1) * g_BufferMemoryAlignment;
|
VkDeviceSize vertex_buffer_size = ((vertex_size-1) / g_BufferMemoryAlignment+1) * g_BufferMemoryAlignment;
|
||||||
VkBufferCreateInfo buffer_info = {};
|
VkBufferCreateInfo buffer_info = {};
|
||||||
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
|
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
|
||||||
buffer_info.size = vertex_buffer_size;
|
buffer_info.size = vertex_buffer_size;
|
||||||
@ -194,7 +193,7 @@ void ImGui_ImplGlfwVulkan_RenderDrawLists(ImDrawData* draw_data)
|
|||||||
vkDestroyBuffer(g_Device, g_IndexBuffer[g_FrameIndex], g_Allocator);
|
vkDestroyBuffer(g_Device, g_IndexBuffer[g_FrameIndex], g_Allocator);
|
||||||
if (g_IndexBufferMemory[g_FrameIndex])
|
if (g_IndexBufferMemory[g_FrameIndex])
|
||||||
vkFreeMemory(g_Device, g_IndexBufferMemory[g_FrameIndex], g_Allocator);
|
vkFreeMemory(g_Device, g_IndexBufferMemory[g_FrameIndex], g_Allocator);
|
||||||
size_t index_buffer_size = ((index_size-1) / g_BufferMemoryAlignment+1) * g_BufferMemoryAlignment;
|
VkDeviceSize index_buffer_size = ((index_size-1) / g_BufferMemoryAlignment+1) * g_BufferMemoryAlignment;
|
||||||
VkBufferCreateInfo buffer_info = {};
|
VkBufferCreateInfo buffer_info = {};
|
||||||
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
|
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
|
||||||
buffer_info.size = index_buffer_size;
|
buffer_info.size = index_buffer_size;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// ImGui - standalone example application for Glfw + Vulkan, using programmable pipeline
|
// ImGui - standalone example application for Glfw + Vulkan, using programmable pipeline
|
||||||
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
|
||||||
|
|
||||||
#include <imgui.h>
|
#include "imgui.h"
|
||||||
|
#include "imgui_impl_glfw_vulkan.h"
|
||||||
|
|
||||||
#include <stdio.h> // printf, fprintf
|
#include <stdio.h> // printf, fprintf
|
||||||
#include <stdlib.h> // abort
|
#include <stdlib.h> // abort
|
||||||
@ -9,8 +10,6 @@
|
|||||||
#define GLFW_INCLUDE_VULKAN
|
#define GLFW_INCLUDE_VULKAN
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#include "imgui_impl_glfw_vulkan.h"
|
|
||||||
|
|
||||||
#define IMGUI_MAX_POSSIBLE_BACK_BUFFERS 16
|
#define IMGUI_MAX_POSSIBLE_BACK_BUFFERS 16
|
||||||
#define IMGUI_UNLIMITED_FRAME_RATE
|
#define IMGUI_UNLIMITED_FRAME_RATE
|
||||||
//#ifdef _DEBUG
|
//#ifdef _DEBUG
|
||||||
|
36
imconfig.h
36
imconfig.h
@ -1,7 +1,10 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// USER IMPLEMENTATION
|
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
|
||||||
// This file contains compile-time options for ImGui.
|
// Most options (memory allocation, clipboard callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
|
||||||
// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
|
//-----------------------------------------------------------------------------
|
||||||
|
// A) You may edit imconfig.h (and not overwrite it when updating imgui, or maintain a patch/branch with your modifications to imconfig.h)
|
||||||
|
// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h"
|
||||||
|
// Note that options such as IMGUI_API, IM_VEC2_CLASS_EXTRA or ImDrawIdx needs to be defined consistently everywhere you include imgui.h, not only for the imgui*.cpp compilation units.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@ -13,30 +16,31 @@
|
|||||||
//#define IMGUI_API __declspec( dllexport )
|
//#define IMGUI_API __declspec( dllexport )
|
||||||
//#define IMGUI_API __declspec( dllimport )
|
//#define IMGUI_API __declspec( dllimport )
|
||||||
|
|
||||||
//---- Don't define obsolete functions names. Consider enabling from time to time or when updating to reduce like hood of using already obsolete function/names
|
//---- Don't define obsolete functions names. Consider enabling from time to time or when updating to reduce likelihood of using already obsolete function/names
|
||||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
|
||||||
//---- Include imgui_user.h at the end of imgui.h
|
//---- Don't implement default handlers for Windows (so as not to link with certain functions)
|
||||||
//#define IMGUI_INCLUDE_IMGUI_USER_H
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // Don't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
||||||
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // Don't use and link with ImmGetContext/ImmSetCompositionWindow.
|
||||||
//---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
|
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
|
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
|
|
||||||
|
|
||||||
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
|
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
|
||||||
//---- It is very strongly recommended to NOT disable the demo windows. Please read the comment at the top of imgui_demo.cpp to learn why.
|
//---- It is very strongly recommended to NOT disable the demo windows. Please read the comment at the top of imgui_demo.cpp.
|
||||||
//#define IMGUI_DISABLE_DEMO_WINDOWS
|
//#define IMGUI_DISABLE_DEMO_WINDOWS
|
||||||
|
|
||||||
//---- Don't implement ImFormatString(), ImFormatStringV() so you can reimplement them yourself.
|
//---- Don't implement ImFormatString(), ImFormatStringV() so you can reimplement them yourself.
|
||||||
//#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
|
//#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS
|
||||||
|
|
||||||
//---- Pack colors to BGRA instead of RGBA (remove need to post process vertex buffer in back ends)
|
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
||||||
|
//#define IMGUI_INCLUDE_IMGUI_USER_H
|
||||||
|
|
||||||
|
//---- Pack colors to BGRA8 instead of RGBA8 (if you needed to convert from one to another anyway)
|
||||||
//#define IMGUI_USE_BGRA_PACKED_COLOR
|
//#define IMGUI_USE_BGRA_PACKED_COLOR
|
||||||
|
|
||||||
//---- Implement STB libraries in a namespace to avoid linkage conflicts
|
//---- Implement STB libraries in a namespace to avoid linkage conflicts (defaults to global namespace)
|
||||||
//#define IMGUI_STB_NAMESPACE ImGuiStb
|
//#define IMGUI_STB_NAMESPACE ImGuiStb
|
||||||
|
|
||||||
//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
|
//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
|
||||||
|
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
|
||||||
/*
|
/*
|
||||||
#define IM_VEC2_CLASS_EXTRA \
|
#define IM_VEC2_CLASS_EXTRA \
|
||||||
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
|
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
|
||||||
@ -47,15 +51,13 @@
|
|||||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//---- Use 32-bit vertex indices (instead of default: 16-bit) to allow meshes with more than 64K vertices
|
//---- Use 32-bit vertex indices (instead of default 16-bit) to allow meshes with more than 64K vertices. Render function needs to support it.
|
||||||
//#define ImDrawIdx unsigned int
|
//#define ImDrawIdx unsigned int
|
||||||
|
|
||||||
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
||||||
//---- e.g. create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers.
|
|
||||||
/*
|
/*
|
||||||
namespace ImGui
|
namespace ImGui
|
||||||
{
|
{
|
||||||
void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL);
|
void MyFunction(const char* name, const MyMatrix44& v);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
10
imgui.h
10
imgui.h
@ -8,9 +8,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
// User-editable configuration files (edit stock imconfig.h or define IMGUI_USER_CONFIG to your own filename)
|
||||||
#include "imconfig.h" // User-editable configuration file
|
#ifdef IMGUI_USER_CONFIG
|
||||||
|
#include IMGUI_USER_CONFIG
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
||||||
|
#include "imconfig.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <float.h> // FLT_MAX
|
#include <float.h> // FLT_MAX
|
||||||
#include <stdarg.h> // va_list
|
#include <stdarg.h> // va_list
|
||||||
#include <stddef.h> // ptrdiff_t, NULL
|
#include <stddef.h> // ptrdiff_t, NULL
|
||||||
@ -1130,6 +1135,7 @@ public:
|
|||||||
Capacity = new_capacity;
|
Capacity = new_capacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NB: &v cannot be pointing inside the ImVector Data itself! e.g. v.push_back(v[10]) is forbidden.
|
||||||
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; }
|
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; }
|
||||||
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
||||||
inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
||||||
|
Loading…
Reference in New Issue
Block a user