From 578016d08bd2f650902064b5b5c599086b9ff5fe Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 27 Jan 2018 17:26:25 +0100 Subject: [PATCH 1/9] ImVector comment (#1577) --- imgui.h | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.h b/imgui.h index a0453eeac..56725bc07 100644 --- a/imgui.h +++ b/imgui.h @@ -1073,6 +1073,7 @@ public: 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 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); } From 3571ab8b8837eb7e3178bbe0caf851a3f73d466b Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 28 Jan 2018 17:21:07 +0100 Subject: [PATCH 2/9] imconfig.h comments --- imconfig.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/imconfig.h b/imconfig.h index 824a81afe..90e127a98 100644 --- a/imconfig.h +++ b/imconfig.h @@ -13,30 +13,31 @@ //#define IMGUI_API __declspec( dllexport ) //#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 -//---- Include imgui_user.h at the end of imgui.h -//#define IMGUI_INCLUDE_IMGUI_USER_H - -//---- 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 default handlers for Windows (so as not to link with certain functions) +//#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 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 //---- Don't implement ImFormatString(), ImFormatStringV() so you can reimplement them yourself. //#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 -//---- 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 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 \ ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ @@ -47,15 +48,13 @@ 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 //---- 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 { - void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL); + void MyFunction(const char* name, const MyMatrix44& v); } */ - From 94090eb08f8b9308be02617893c06dda9a02329d Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 28 Jan 2018 17:47:28 +0100 Subject: [PATCH 3/9] Added IMGUI_USER_CONFIG to define a custom configuration filename. (#255, #1573, #1144, #41) --- imconfig.h | 9 ++++++--- imgui.h | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/imconfig.h b/imconfig.h index 90e127a98..afa54914c 100644 --- a/imconfig.h +++ b/imconfig.h @@ -1,7 +1,10 @@ //----------------------------------------------------------------------------- -// USER IMPLEMENTATION -// This file contains compile-time options for ImGui. -// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO(). +// COMPILE-TIME OPTIONS FOR DEAR IMGUI +// Most options (memory allocation, clipboard 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 diff --git a/imgui.h b/imgui.h index 56725bc07..40b951491 100644 --- a/imgui.h +++ b/imgui.h @@ -8,9 +8,14 @@ #pragma once -#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) -#include "imconfig.h" // User-editable configuration file +// User-editable configuration files (edit stock imconfig.h or define IMGUI_USER_CONFIG to your own filename) +#ifdef IMGUI_USER_CONFIG +#include IMGUI_USER_CONFIG #endif +#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) +#include "imconfig.h" +#endif + #include // FLT_MAX #include // va_list #include // ptrdiff_t, NULL From 66d5712a8a60493b55eaf2d77310b9ed44d88792 Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 28 Jan 2018 20:03:41 +0100 Subject: [PATCH 4/9] Examples: Vulkan: FIxed warnings in 32-bit modes (vulkan uses VkDeviceSize which is always 64-bit long) --- examples/vulkan_example/imgui_impl_glfw_vulkan.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp index b9e6d78f2..080d57d3e 100644 --- a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp +++ b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp @@ -36,7 +36,7 @@ static VkDescriptorPool g_DescriptorPool = VK_NULL_HANDLE; static void (*g_CheckVkResult)(VkResult err) = NULL; static VkCommandBuffer g_CommandBuffer = VK_NULL_HANDLE; -static size_t g_BufferMemoryAlignment = 256; +static VkDeviceSize g_BufferMemoryAlignment = 256; static VkPipelineCreateFlags g_PipelineCreateFlags = 0; static int g_FrameIndex = 0; @@ -52,8 +52,8 @@ static VkImageView g_FontView = VK_NULL_HANDLE; static VkDeviceMemory g_VertexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {}; static VkDeviceMemory g_IndexBufferMemory[IMGUI_VK_QUEUED_FRAMES] = {}; -static size_t g_VertexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {}; -static size_t g_IndexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {}; +static VkDeviceSize g_VertexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {}; +static VkDeviceSize g_IndexBufferSize[IMGUI_VK_QUEUED_FRAMES] = {}; static VkBuffer g_VertexBuffer[IMGUI_VK_QUEUED_FRAMES] = {}; static VkBuffer g_IndexBuffer[IMGUI_VK_QUEUED_FRAMES] = {}; @@ -164,7 +164,7 @@ void ImGui_ImplGlfwVulkan_RenderDrawLists(ImDrawData* draw_data) vkDestroyBuffer(g_Device, g_VertexBuffer[g_FrameIndex], g_Allocator); if (g_VertexBufferMemory[g_FrameIndex]) 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 = {}; buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; buffer_info.size = vertex_buffer_size; @@ -194,7 +194,7 @@ void ImGui_ImplGlfwVulkan_RenderDrawLists(ImDrawData* draw_data) vkDestroyBuffer(g_Device, g_IndexBuffer[g_FrameIndex], g_Allocator); if (g_IndexBufferMemory[g_FrameIndex]) 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 = {}; buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; buffer_info.size = index_buffer_size; From 858d75ab59c96d4689c5337c1750c32b9228e6be Mon Sep 17 00:00:00 2001 From: Omar Cornut Date: Sun, 28 Jan 2018 23:24:57 +0100 Subject: [PATCH 5/9] Examples: Apple: Fixed filenames in OSX xcode project. --- .../imguiex.xcodeproj/project.pbxproj | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/apple_example/imguiex.xcodeproj/project.pbxproj b/examples/apple_example/imguiex.xcodeproj/project.pbxproj index be43fb60c..3e5b07894 100644 --- a/examples/apple_example/imguiex.xcodeproj/project.pbxproj +++ b/examples/apple_example/imguiex.xcodeproj/project.pbxproj @@ -17,8 +17,8 @@ 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 */; }; 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 */; }; - 1A1A0F4E1CB3C54D0090F036 /* libglfw3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */; }; + 1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw_gl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */; }; + 1A1A0F4E1CB3C54D0090F036 /* libglfw.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */; }; 6D1E39171B35EEF10017B40F /* uSynergy.c in Sources */ = {isa = PBXBuildFile; fileRef = 6D1E39151B35EEF10017B40F /* uSynergy.c */; }; 6D2FC55A1B2E632000C130BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2FC5591B2E632000C130BA /* main.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 = ""; }; 1A1A0F271CB39FB50090F036 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 1A1A0F2C1CB39FB50090F036 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imgui_impl_glfw.cpp; sourceTree = ""; }; - 1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imgui_impl_glfw.h; sourceTree = ""; }; + 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imgui_impl_glfw_gl2.cpp; sourceTree = ""; }; + 1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw_gl2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imgui_impl_glfw_gl2.h; sourceTree = ""; }; 1A1A0F391CB3A1B20090F036 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libglfw3.dylib; path = /usr/local/lib/libglfw3.dylib; sourceTree = ""; }; + 1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libglfw.dylib; path = /usr/local/lib/libglfw.dylib; sourceTree = ""; }; 6D1E39151B35EEF10017B40F /* uSynergy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uSynergy.c; sourceTree = ""; }; 6D1E39161B35EEF10017B40F /* uSynergy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uSynergy.h; sourceTree = ""; }; 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; buildActionMask = 2147483647; files = ( - 1A1A0F4E1CB3C54D0090F036 /* libglfw3.dylib in Frameworks */, + 1A1A0F4E1CB3C54D0090F036 /* libglfw.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -96,7 +96,7 @@ 1A1A0F201CB39FB50090F036 /* imguiex-osx */ = { isa = PBXGroup; children = ( - 1A1A0F4D1CB3C54D0090F036 /* libglfw3.dylib */, + 1A1A0F4D1CB3C54D0090F036 /* libglfw.dylib */, 1A1A0F351CB3A1B20090F036 /* opengl2_example */, 1A1A0F211CB39FB50090F036 /* AppDelegate.h */, 1A1A0F221CB39FB50090F036 /* AppDelegate.m */, @@ -117,8 +117,8 @@ 1A1A0F351CB3A1B20090F036 /* opengl2_example */ = { isa = PBXGroup; children = ( - 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw.cpp */, - 1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw.h */, + 1A1A0F371CB3A1B20090F036 /* imgui_impl_glfw_gl2.cpp */, + 1A1A0F381CB3A1B20090F036 /* imgui_impl_glfw_gl2.h */, 1A1A0F391CB3A1B20090F036 /* main.cpp */, ); name = opengl2_example; @@ -307,7 +307,7 @@ 1A1A0F481CB3A2E50090F036 /* main.cpp in Sources */, 1A1A0F321CB3A0DE0090F036 /* uSynergy.c in Sources */, 1A1A0F231CB39FB50090F036 /* AppDelegate.m in Sources */, - 1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw.cpp in Sources */, + 1A1A0F4A1CB3A5070090F036 /* imgui_impl_glfw_gl2.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From ddff378daf86c8806f04d31c2e0e092330983a3f Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 29 Jan 2018 00:38:00 +0100 Subject: [PATCH 6/9] Examples: Synced Makefile comments. Added build/ folder into git ignore list/ --- examples/.gitignore | 2 +- examples/opengl2_example/Makefile | 12 ++++++++---- examples/opengl3_example/Makefile | 13 +++++++------ examples/sdl_opengl3_example/Makefile | 13 +++++++------ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/.gitignore b/examples/.gitignore index 9516dc7f6..127854990 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,4 +1,4 @@ -## Visual Studio files +build/* Debug/* Release/* ipch/* diff --git a/examples/opengl2_example/Makefile b/examples/opengl2_example/Makefile index f10c59a8d..ea96af449 100644 --- a/examples/opengl2_example/Makefile +++ b/examples/opengl2_example/Makefile @@ -2,10 +2,13 @@ # Cross Platform Makefile # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X # -# -# if you using Mac OS X: -# You'll need glfw -# http://www.glfw.org +# You will need GLFW (http://www.glfw.org): +# Linux: +# apt-get install libglfw-dev +# Mac OS X: +# brew install glfw +# MSYS2: +# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw # #CXX = g++ @@ -46,6 +49,7 @@ ifeq ($(findstring MINGW,$(UNAME_S)),MINGW) CFLAGS = $(CXXFLAGS) endif + .cpp.o: $(CXX) $(CXXFLAGS) -c -o $@ $< diff --git a/examples/opengl3_example/Makefile b/examples/opengl3_example/Makefile index 32343ed23..63eaf75c3 100644 --- a/examples/opengl3_example/Makefile +++ b/examples/opengl3_example/Makefile @@ -2,12 +2,13 @@ # Cross Platform Makefile # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X # -# -# You will need GLFW (http://www.glfw.org) -# -# apt-get install libglfw-dev # Linux -# brew install glfw # Mac OS X -# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw # MSYS2 +# You will need GLFW (http://www.glfw.org): +# Linux: +# apt-get install libglfw-dev +# Mac OS X: +# brew install glfw +# MSYS2: +# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw # #CXX = g++ diff --git a/examples/sdl_opengl3_example/Makefile b/examples/sdl_opengl3_example/Makefile index 364ca1239..b454bebd4 100644 --- a/examples/sdl_opengl3_example/Makefile +++ b/examples/sdl_opengl3_example/Makefile @@ -2,12 +2,13 @@ # Cross Platform Makefile # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X # -# -# You will need SDL2 (http://www.libsdl.org) -# -# apt-get install libsdl2-dev # Linux -# brew install sdl2 # Mac OS X -# pacman -S mingw-w64-i686-SDL # MSYS2 +# You will need SDL2 (http://www.libsdl.org): +# Linux: +# apt-get install libsdl2-dev +# Mac OS X: +# brew install sdl2 +# MSYS2: +# pacman -S mingw-w64-i686-SDL # #CXX = g++ From 3cdd2096ec3998aef478a66feb1bb700de69b0d4 Mon Sep 17 00:00:00 2001 From: Omar Cornut Date: Mon, 29 Jan 2018 00:48:21 +0100 Subject: [PATCH 7/9] Examples: Use Clang in old Makefile. --- examples/opengl2_example/Makefile | 1 + examples/opengl3_example/Makefile | 1 + examples/sdl_opengl3_example/Makefile | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/opengl2_example/Makefile b/examples/opengl2_example/Makefile index ea96af449..e00891baa 100644 --- a/examples/opengl2_example/Makefile +++ b/examples/opengl2_example/Makefile @@ -12,6 +12,7 @@ # #CXX = g++ +CXX = clang++ EXE = opengl2_example OBJS = main.o imgui_impl_glfw_gl2.o diff --git a/examples/opengl3_example/Makefile b/examples/opengl3_example/Makefile index 63eaf75c3..881c9bd19 100644 --- a/examples/opengl3_example/Makefile +++ b/examples/opengl3_example/Makefile @@ -12,6 +12,7 @@ # #CXX = g++ +CXX = clang++ EXE = opengl3_example OBJS = main.o imgui_impl_glfw_gl3.o diff --git a/examples/sdl_opengl3_example/Makefile b/examples/sdl_opengl3_example/Makefile index b454bebd4..06e4d880f 100644 --- a/examples/sdl_opengl3_example/Makefile +++ b/examples/sdl_opengl3_example/Makefile @@ -12,6 +12,7 @@ # #CXX = g++ +CXX = clang++ EXE = sdl_opengl3_example OBJS = main.o imgui_impl_sdl_gl3.o From 91d77be36e2067ce51c64262d0df1efa53e0d470 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 29 Jan 2018 00:55:16 +0100 Subject: [PATCH 8/9] Examples: Makefile leave CXX alone, instead leave commented out options. (nb: codeship doesn't seem have clang++) --- examples/opengl2_example/Makefile | 2 +- examples/opengl3_example/Makefile | 2 +- examples/sdl_opengl3_example/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/opengl2_example/Makefile b/examples/opengl2_example/Makefile index e00891baa..b0ee3152d 100644 --- a/examples/opengl2_example/Makefile +++ b/examples/opengl2_example/Makefile @@ -12,7 +12,7 @@ # #CXX = g++ -CXX = clang++ +#CXX = clang++ EXE = opengl2_example OBJS = main.o imgui_impl_glfw_gl2.o diff --git a/examples/opengl3_example/Makefile b/examples/opengl3_example/Makefile index 881c9bd19..133c0a64e 100644 --- a/examples/opengl3_example/Makefile +++ b/examples/opengl3_example/Makefile @@ -12,7 +12,7 @@ # #CXX = g++ -CXX = clang++ +#CXX = clang++ EXE = opengl3_example OBJS = main.o imgui_impl_glfw_gl3.o diff --git a/examples/sdl_opengl3_example/Makefile b/examples/sdl_opengl3_example/Makefile index 06e4d880f..45f6a6631 100644 --- a/examples/sdl_opengl3_example/Makefile +++ b/examples/sdl_opengl3_example/Makefile @@ -12,7 +12,7 @@ # #CXX = g++ -CXX = clang++ +#CXX = clang++ EXE = sdl_opengl3_example OBJS = main.o imgui_impl_sdl_gl3.o From 6a25a8720ac27573225643a1188d8a49b4ad614e Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 29 Jan 2018 14:38:46 +0100 Subject: [PATCH 9/9] Examples: Using #include "imgui.h" instead of appear correct-er as per standard? xcode+clang are very nitpicky there. --- examples/allegro5_example/imgui_impl_a5.cpp | 2 +- examples/allegro5_example/main.cpp | 2 +- examples/directx10_example/main.cpp | 2 +- examples/directx11_example/imgui_impl_dx11.cpp | 2 +- examples/directx11_example/main.cpp | 2 +- examples/directx9_example/imgui_impl_dx9.cpp | 2 +- examples/directx9_example/main.cpp | 2 +- examples/marmalade_example/imgui_impl_marmalade.cpp | 2 +- examples/marmalade_example/main.cpp | 2 +- examples/null_example/main.cpp | 2 +- examples/opengl2_example/imgui_impl_glfw_gl2.cpp | 2 +- examples/opengl2_example/main.cpp | 2 +- examples/opengl3_example/imgui_impl_glfw_gl3.cpp | 2 +- examples/opengl3_example/main.cpp | 2 +- examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp | 2 +- examples/sdl_opengl2_example/main.cpp | 2 +- examples/sdl_opengl3_example/main.cpp | 2 +- examples/vulkan_example/imgui_impl_glfw_vulkan.cpp | 5 ++--- examples/vulkan_example/main.cpp | 5 ++--- 19 files changed, 21 insertions(+), 23 deletions(-) diff --git a/examples/allegro5_example/imgui_impl_a5.cpp b/examples/allegro5_example/imgui_impl_a5.cpp index 62f7af672..426913621 100644 --- a/examples/allegro5_example/imgui_impl_a5.cpp +++ b/examples/allegro5_example/imgui_impl_a5.cpp @@ -12,7 +12,7 @@ #include // uint64_t #include // memcpy -#include +#include "imgui.h" #include "imgui_impl_a5.h" #include #include diff --git a/examples/allegro5_example/main.cpp b/examples/allegro5_example/main.cpp index 3c9c9770e..7ecf43213 100644 --- a/examples/allegro5_example/main.cpp +++ b/examples/allegro5_example/main.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include "imgui.h" #include "imgui_impl_a5.h" int main(int, char**) diff --git a/examples/directx10_example/main.cpp b/examples/directx10_example/main.cpp index 38f4054ea..fccdda60f 100644 --- a/examples/directx10_example/main.cpp +++ b/examples/directx10_example/main.cpp @@ -1,7 +1,7 @@ // 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. -#include +#include "imgui.h" #include "imgui_impl_dx10.h" #include #include diff --git a/examples/directx11_example/imgui_impl_dx11.cpp b/examples/directx11_example/imgui_impl_dx11.cpp index 4963fc12e..25742cb7a 100644 --- a/examples/directx11_example/imgui_impl_dx11.cpp +++ b/examples/directx11_example/imgui_impl_dx11.cpp @@ -6,7 +6,7 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include +#include "imgui.h" #include "imgui_impl_dx11.h" // DirectX diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index 79e7bb169..f1e3b8ac8 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -1,7 +1,7 @@ // 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. -#include +#include "imgui.h" #include "imgui_impl_dx11.h" #include #define DIRECTINPUT_VERSION 0x0800 diff --git a/examples/directx9_example/imgui_impl_dx9.cpp b/examples/directx9_example/imgui_impl_dx9.cpp index a4e676914..b47a840b6 100644 --- a/examples/directx9_example/imgui_impl_dx9.cpp +++ b/examples/directx9_example/imgui_impl_dx9.cpp @@ -6,7 +6,7 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include +#include "imgui.h" #include "imgui_impl_dx9.h" // DirectX diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index 09a109d98..d0323dca0 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -1,7 +1,7 @@ // 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. -#include +#include "imgui.h" #include "imgui_impl_dx9.h" #include #define DIRECTINPUT_VERSION 0x0800 diff --git a/examples/marmalade_example/imgui_impl_marmalade.cpp b/examples/marmalade_example/imgui_impl_marmalade.cpp index 36fc8328c..0bffb30d8 100644 --- a/examples/marmalade_example/imgui_impl_marmalade.cpp +++ b/examples/marmalade_example/imgui_impl_marmalade.cpp @@ -9,7 +9,7 @@ // Copyright (C) 2015 by Giovanni Zito // This file is part of ImGui -#include +#include "imgui.h" #include "imgui_impl_marmalade.h" #include diff --git a/examples/marmalade_example/main.cpp b/examples/marmalade_example/main.cpp index 2b5edb77f..338c469cd 100644 --- a/examples/marmalade_example/main.cpp +++ b/examples/marmalade_example/main.cpp @@ -4,7 +4,7 @@ // Copyright (C) 2015 by Giovanni Zito // This file is part of ImGui -#include +#include "imgui.h" #include "imgui_impl_marmalade.h" #include diff --git a/examples/null_example/main.cpp b/examples/null_example/main.cpp index 04c1bda40..3dd41b0e6 100644 --- a/examples/null_example/main.cpp +++ b/examples/null_example/main.cpp @@ -1,5 +1,5 @@ // ImGui - null/dummy example application (compile and link imgui with no inputs, no outputs) -#include +#include "imgui.h" #include int main(int, char**) diff --git a/examples/opengl2_example/imgui_impl_glfw_gl2.cpp b/examples/opengl2_example/imgui_impl_glfw_gl2.cpp index e5fe2f47b..27052b60d 100644 --- a/examples/opengl2_example/imgui_impl_glfw_gl2.cpp +++ b/examples/opengl2_example/imgui_impl_glfw_gl2.cpp @@ -15,7 +15,7 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include +#include "imgui.h" #include "imgui_impl_glfw_gl2.h" // GLFW diff --git a/examples/opengl2_example/main.cpp b/examples/opengl2_example/main.cpp index 6359f5b62..01eba4fbb 100644 --- a/examples/opengl2_example/main.cpp +++ b/examples/opengl2_example/main.cpp @@ -6,7 +6,7 @@ // **Prefer using the code in the opengl3_example/ folder** // See imgui_impl_glfw.cpp for details. -#include +#include "imgui.h" #include "imgui_impl_glfw_gl2.h" #include #include diff --git a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp index a71fc515d..f02692b2a 100644 --- a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp +++ b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp @@ -8,7 +8,7 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include +#include "imgui.h" #include "imgui_impl_glfw_gl3.h" // GL3W/GLFW diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 6beb855dc..26de8ca23 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -3,7 +3,7 @@ // (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.) -#include +#include "imgui.h" #include "imgui_impl_glfw_gl3.h" #include #include // 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. diff --git a/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp b/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp index 76def29c3..801c433f0 100644 --- a/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp +++ b/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include "imgui.h" #include "imgui_impl_sdl_gl2.h" // Data diff --git a/examples/sdl_opengl2_example/main.cpp b/examples/sdl_opengl2_example/main.cpp index 21b567a83..bc4756479 100644 --- a/examples/sdl_opengl2_example/main.cpp +++ b/examples/sdl_opengl2_example/main.cpp @@ -6,7 +6,7 @@ // **Prefer using the code in the sdl_opengl3_example/ folder** // See imgui_impl_sdl.cpp for details. -#include +#include "imgui.h" #include "imgui_impl_sdl_gl2.h" #include #include diff --git a/examples/sdl_opengl3_example/main.cpp b/examples/sdl_opengl3_example/main.cpp index 7ee60389c..6321181df 100644 --- a/examples/sdl_opengl3_example/main.cpp +++ b/examples/sdl_opengl3_example/main.cpp @@ -3,7 +3,7 @@ // (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.) -#include +#include "imgui.h" #include "imgui_impl_sdl_gl3.h" #include #include // 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. diff --git a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp index 080d57d3e..3748b504b 100644 --- a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp +++ b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp @@ -6,7 +6,8 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include +#include "imgui.h" +#include "imgui_impl_glfw_vulkan.h" // GLFW #define GLFW_INCLUDE_NONE @@ -19,8 +20,6 @@ #include #endif -#include "imgui_impl_glfw_vulkan.h" - // GLFW Data static GLFWwindow* g_Window = NULL; static double g_Time = 0.0f; diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index 6c4ef33fe..75b08d225 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -1,7 +1,8 @@ // 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. -#include +#include "imgui.h" +#include "imgui_impl_glfw_vulkan.h" #include // printf, fprintf #include // abort @@ -9,8 +10,6 @@ #define GLFW_INCLUDE_VULKAN #include -#include "imgui_impl_glfw_vulkan.h" - #define IMGUI_MAX_POSSIBLE_BACK_BUFFERS 16 #define IMGUI_UNLIMITED_FRAME_RATE //#ifdef _DEBUG