From 40845852b934aac687605a9e8f3f966dc91a5e91 Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 16 Jun 2018 10:23:11 +0200 Subject: [PATCH 1/8] Fixed warnings + readme --- examples/README.txt | 4 ++-- imgui.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/README.txt b/examples/README.txt index 7956e455..52610f4a 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -122,12 +122,12 @@ List of high-level Frameworks Bindings in this repository: (combine Platform + R imgui_impl_allegro5.cpp imgui_impl_marmalade.cpp -Third-party framework, graphics API and languages bindings: +Third-party framework, graphics API and languages bindings are listed at: https://github.com/ocornut/imgui/wiki/Links Languages: C, C#, ChaiScript, D, Go, Haxe, Java, Lua, Odin, Pascal, PureBasic, Python, Rust, Swift... - Frameworks: Cinder, Cocos2d-x, Emscripten, SFML, GML/GameMaker Studio, Irrlicht, Ogre, + Frameworks: Cinder, Cocoa (OSX), Cocos2d-x, Emscripten, SFML, GML/GameMaker Studio, Irrlicht, Ogre, OpenSceneGraph, openFrameworks, LOVE, NanoRT, Nim Game Lib, Qt3d, SFML, Unreal Engine 4... Miscellaneous: Software Renderer, RemoteImgui, etc. diff --git a/imgui.cpp b/imgui.cpp index beefcfcd..2cdc1900 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2254,6 +2254,7 @@ void ImGui::MarkItemValueChanged(ImGuiID id) { // This marking is solely to be able to provide info for IsItemDeactivatedAfterChange(). // ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need need to fill the data. + (void)id; // Avoid unused variable warnings when asserts are compiled out. ImGuiContext& g = *GImGui; IM_ASSERT(g.ActiveId == id || g.ActiveId == 0); g.ActiveIdValueChanged = true; From 2ce121b7d05700b8f6252a987cb7b2e6695f5c5c Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 16 Jun 2018 10:43:05 +0200 Subject: [PATCH 2/8] Readme, Links, Bindings --- README.md | 23 ++++++++++++----------- examples/README.txt | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 693827f7..5b5fb2b7 100644 --- a/README.md +++ b/README.md @@ -108,30 +108,31 @@ Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/ _NB: those third-party bindings may be more or less maintained, more or less close to the original API (as people who create language bindings sometimes haven't used the C++ API themselves.. for the good reason that they aren't C++ users). Dear ImGui was designed with C++ in mind and some of the subtleties may be lost in translation with other languages. If your language supports it, I would suggest replicating the function overloading and default parameters used in the original, else the API may be harder to use. In doubt, please check the original C++ version first!_ Languages: (third-party bindings) -- C: [cimgui](https://github.com/Extrawurst/cimgui) +- C: [cimgui](https://github.com/Extrawurst/cimgui) and [#1879](https://github.com/ocornut/imgui/issues/1879) - C#/.Net: [ImGui.NET](https://github.com/mellinoe/ImGui.NET) - ChaiScript: [imgui-chaiscript](https://github.com/JuJuBoSc/imgui-chaiscript) - D: [DerelictImgui](https://github.com/Extrawurst/DerelictImgui) - Go: [go-imgui](https://github.com/Armored-Dragon/go-imgui) - Haxe/hxcpp: [linc_imgui](https://github.com/Aidan63/linc_imgui) -- JavaScript: [imgui-js](https://github.com/flyover/imgui-js) - Java: [jimgui](https://github.com/ice1000/jimgui) +- JavaScript: [imgui-js](https://github.com/flyover/imgui-js) - Lua: [imgui_lua_bindings](https://github.com/patrickriordan/imgui_lua_bindings) or [lua-ffi-bindings](https://github.com/thenumbernine/lua-ffi-bindings) - Odin: [odin-dear_imgui](https://github.com/ThisDrunkDane/odin-dear_imgui) - Pascal: [imgui-pas](https://github.com/dpethes/imgui-pas) - PureBasic: [pb-cimgui](https://github.com/hippyau/pb-cimgui) - Python [CyImGui](https://github.com/chromy/cyimgui) or [pyimgui](https://github.com/swistakm/pyimgui) - Rust: [imgui-rs](https://github.com/Gekkio/imgui-rs) +- Swift [swift-imgui](https://github.com/mnmly/Swift-imgui) Frameworks: -- DirectX 9, DirectX 10, DirectX 11, DirectX 12: [examples/](https://github.com/ocornut/imgui/tree/master/examples) -- OpenGL 2/3 (with GLFW or SDL): [examples/](https://github.com/ocornut/imgui/tree/master/examples) -- Vulkan (with GLFW): [examples/](https://github.com/ocornut/imgui/tree/master/examples) -- Allegro 5, iOS, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples) +- Renderers: DirectX 9, DirectX 10, DirectX 11, DirectX 12, OpenGL2, OpenGL3+, Vulkan: [examples/](https://github.com/ocornut/imgui/tree/master/examples) +- Platform: GLFW, SDL, Win32, Freeglut: [examples/](https://github.com/ocornut/imgui/tree/master/examples) +- Framework: Allegro 5, Marmalade: [examples/](https://github.com/ocornut/imgui/tree/master/examples) +- Unmerged Branch: OSX platform without GLFW/SDL: [#1873](https://github.com/ocornut/imgui/tree/osx) - Unmerged PR: SDL2 + OpenGLES + Emscripten: [#336](https://github.com/ocornut/imgui/pull/336) -- Unmerged PR: FreeGlut + OpenGL2: [#801](https://github.com/ocornut/imgui/pull/801) - Unmerged PR: Native Win32 and OSX: [#281](https://github.com/ocornut/imgui/pull/281) - Unmerged PR: Android: [#421](https://github.com/ocornut/imgui/pull/421) +- Unmerged PR: ORX: [#1843](https://github.com/ocornut/imgui/pull/1843) - Cinder: [Cinder-ImGui](https://github.com/simongeilfus/Cinder-ImGui) - Cocos2d-x: [imguix](https://github.com/c0i/imguix), [issue #551](https://github.com/ocornut/imgui/issues/551) - Flexium/SFML: [FlexGUI](https://github.com/DXsmiley/FlexGUI) @@ -140,7 +141,7 @@ Frameworks: - Ogre: [ogreimgui](https://bitbucket.org/LMCrashy/ogreimgui/src) - OpenFrameworks: [ofxImGui](https://github.com/jvcleave/ofxImGui) - OpenSceneGraph/OSG: [gist](https://gist.github.com/fulezi/d2442ca7626bf270226014501357042c) -- LÖVE: [love-imgui](https://github.com/slages/love-imgui) +- LÖVE+Lua: [love-imgui](https://github.com/slages/love-imgui) - Magnum: [magnum-imgui](https://github.com/lecopivo/magnum-imgui), [MagnumImguiPort](https://github.com/lecopivo/MagnumImguiPort) - NanoRT: [syoyo/imgui](https://github.com/syoyo/imgui/tree/nanort) - Qt3d: [imgui-qt3d](https://github.com/alpqr/imgui-qt3d) @@ -148,7 +149,7 @@ Frameworks: - Software renderer: [imgui_software_renderer](https://github.com/emilk/imgui_software_renderer) - Unreal Engine 4: [segross/UnrealImGui](https://github.com/segross/UnrealImGui) or [sronsse/UnrealEngine_ImGui](https://github.com/sronsse/UnrealEngine_ImGui) -For other bindings: see [this page](https://github.com/ocornut/imgui/wiki/Links/). Also see [wiki](https://github.com/ocornut/imgui/wiki) for a few other links and ideas. Contact me if you would like to add to those lists. +For other bindings: see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings/). Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas. Roadmap ------- @@ -210,7 +211,7 @@ The Immediate Mode GUI paradigm may at first appear unusual to some users. This - [Nicolas Guillemot's CppCon'16 flash-talk about Dear ImGui](https://www.youtube.com/watch?v=LSRJ1jZq90k). - [Thierry Excoffier's Zero Memory Widget](http://perso.univ-lyon1.fr/thierry.excoffier/ZMW/). -See the [Links page](https://github.com/ocornut/imgui/wiki/Links) for third-party bindings to different languages and frameworks. +See the [Wiki](https://github.com/ocornut/imgui/wiki) and [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for third-party bindings to different languages and frameworks. Frequently Asked Question (FAQ) ------------------------------- @@ -272,7 +273,7 @@ You can alter the look of the interface to some degree: changing colors, sizes, Dear ImGui takes advantage of a few C++ languages features for convenience but nothing anywhere Boost-insanity/quagmire. Dear ImGui does NOT require C++11 so it can be used with most old C++ compilers. Dear ImGui doesn't use any C++ header file. Language-wise, function overloading and default parameters are used to make the API easier to use and code more terse. Doing so I believe the API is sitting on a sweet spot and giving up on those features would make the API more cumbersome. Other features such as namespace, constructors and templates (in the case of the ImVector<> class) are also relied on as a convenience. -There is an reasonably maintained [c-api for ImGui](https://github.com/Extrawurst/cimgui) by Stephan Dilly designed for binding in other languages. I would suggest using your target language functionalities to try replicating the function overloading and default parameters used in C++ else the API may be harder to use. Also see [Links](https://github.com/ocornut/imgui/wiki/Links) for third-party bindings to other languages. +There is an reasonably maintained [c-api for ImGui](https://github.com/Extrawurst/cimgui) by Stephan Dilly designed for binding in other languages. I would suggest using your target language functionalities to try replicating the function overloading and default parameters used in C++ else the API may be harder to use. Also see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for third-party bindings to other languages. Support dear imgui ------------------ diff --git a/examples/README.txt b/examples/README.txt index 52610f4a..405768ce 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -124,7 +124,7 @@ List of high-level Frameworks Bindings in this repository: (combine Platform + R Third-party framework, graphics API and languages bindings are listed at: - https://github.com/ocornut/imgui/wiki/Links + https://github.com/ocornut/imgui/wiki/Bindings Languages: C, C#, ChaiScript, D, Go, Haxe, Java, Lua, Odin, Pascal, PureBasic, Python, Rust, Swift... Frameworks: Cinder, Cocoa (OSX), Cocos2d-x, Emscripten, SFML, GML/GameMaker Studio, Irrlicht, Ogre, From c44a4bed84e8d65f08f970d6cbdd79f35f9c264e Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 20 Jun 2018 11:06:29 +0200 Subject: [PATCH 3/8] Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887) --- CHANGELOG.txt | 1 + examples/imgui_impl_glfw.cpp | 4 ++-- examples/imgui_impl_sdl.cpp | 4 ++-- examples/imgui_impl_win32.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1d4fe60b..eaf6d356 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -84,6 +84,7 @@ Other Changes: - Examples: Allegro5: Added support for ImGuiConfigFlags_NoMouseCursorChange flag. Added clipboard support. - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end. - Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801) + - Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887) - Misc: Updated stb_textedit from 1.09 + patches to 1.12 + minor patches. - Internals: PushItemFlag() flags are inherited by BeginChild(). diff --git a/examples/imgui_impl_glfw.cpp b/examples/imgui_impl_glfw.cpp index d70991af..39134383 100644 --- a/examples/imgui_impl_glfw.cpp +++ b/examples/imgui_impl_glfw.cpp @@ -53,7 +53,7 @@ static GLFWwindow* g_Window = NULL; static GlfwClientApi g_ClientApi = GlfwClientApi_Unknown; static double g_Time = 0.0; static bool g_MouseJustPressed[5] = { false, false, false, false, false }; -static GLFWcursor* g_MouseCursors[ImGuiMouseCursor_Count_] = { 0 }; +static GLFWcursor* g_MouseCursors[ImGuiMouseCursor_COUNT] = { 0 }; static const char* ImGui_ImplGlfw_GetClipboardText(void* user_data) { @@ -175,7 +175,7 @@ bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks) void ImGui_ImplGlfw_Shutdown() { - for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_Count_; cursor_n++) + for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++) { glfwDestroyCursor(g_MouseCursors[cursor_n]); g_MouseCursors[cursor_n] = NULL; diff --git a/examples/imgui_impl_sdl.cpp b/examples/imgui_impl_sdl.cpp index 4027d5f0..3fae6c7b 100644 --- a/examples/imgui_impl_sdl.cpp +++ b/examples/imgui_impl_sdl.cpp @@ -50,7 +50,7 @@ static const Uint32 SDL_WINDOW_VULKAN = 0x10000000; static SDL_Window* g_Window = NULL; static Uint64 g_Time = 0; static bool g_MousePressed[3] = { false, false, false }; -static SDL_Cursor* g_MouseCursors[ImGuiMouseCursor_Count_] = { 0 }; +static SDL_Cursor* g_MouseCursors[ImGuiMouseCursor_COUNT] = { 0 }; static char* g_ClipboardTextData = NULL; static const char* ImGui_ImplSDL2_GetClipboardText(void*) @@ -193,7 +193,7 @@ void ImGui_ImplSDL2_Shutdown() g_ClipboardTextData = NULL; // Destroy SDL mouse cursors - for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_Count_; cursor_n++) + for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++) SDL_FreeCursor(g_MouseCursors[cursor_n]); memset(g_MouseCursors, 0, sizeof(g_MouseCursors)); } diff --git a/examples/imgui_impl_win32.cpp b/examples/imgui_impl_win32.cpp index 19eb8773..1b39e068 100644 --- a/examples/imgui_impl_win32.cpp +++ b/examples/imgui_impl_win32.cpp @@ -31,7 +31,7 @@ static HWND g_hWnd = 0; static INT64 g_Time = 0; static INT64 g_TicksPerSecond = 0; -static ImGuiMouseCursor g_LastMouseCursor = ImGuiMouseCursor_Count_; +static ImGuiMouseCursor g_LastMouseCursor = ImGuiMouseCursor_COUNT; // Functions bool ImGui_ImplWin32_Init(void* hwnd) From 528b0b4af6b9a8703a5a09c77a9eb35435e84ef4 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 20 Jun 2018 11:17:33 +0200 Subject: [PATCH 4/8] Examples: SDL+OpenGL2: Fixed Makefile. (#1886) --- examples/example_sdl_opengl2/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/example_sdl_opengl2/Makefile b/examples/example_sdl_opengl2/Makefile index a295ac22..1872d7cb 100644 --- a/examples/example_sdl_opengl2/Makefile +++ b/examples/example_sdl_opengl2/Makefile @@ -26,7 +26,7 @@ ifeq ($(UNAME_S), Linux) #LINUX ECHO_MESSAGE = "Linux" LIBS = -lGL -ldl `sdl2-config --libs` - CXXFLAGS = -I../../ `sdl2-config --cflags` + CXXFLAGS = -I ../ -I../../ `sdl2-config --cflags` CXXFLAGS += -Wall -Wformat CFLAGS = $(CXXFLAGS) endif @@ -35,7 +35,7 @@ ifeq ($(UNAME_S), Darwin) #APPLE ECHO_MESSAGE = "Mac OS X" LIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` - CXXFLAGS = -I../../ -I/usr/local/include `sdl2-config --cflags` + CXXFLAGS = -I ../ -I../../ -I/usr/local/include `sdl2-config --cflags` CXXFLAGS += -Wall -Wformat CFLAGS = $(CXXFLAGS) endif @@ -44,7 +44,7 @@ ifeq ($(findstring MINGW,$(UNAME_S)),MINGW) ECHO_MESSAGE = "Windows" LIBS = -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` - CXXFLAGS = -I../../ `pkg-config --cflags sdl2` + CXXFLAGS = -I ../ -I../../ `pkg-config --cflags sdl2` CXXFLAGS += -Wall -Wformat CFLAGS = $(CXXFLAGS) endif From cac4c3f9b8ce74e27acf612f45dc25615dcda4f7 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 21 Jun 2018 12:04:00 +0200 Subject: [PATCH 5/8] Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) + Comments in imgui.h --- CHANGELOG.txt | 1 + examples/imgui_impl_allegro5.h | 14 +++++++------- examples/imgui_impl_dx10.h | 12 ++++++------ examples/imgui_impl_dx11.h | 12 ++++++------ examples/imgui_impl_dx12.h | 14 +++++++------- examples/imgui_impl_dx9.h | 12 ++++++------ examples/imgui_impl_freeglut.h | 26 ++++++++++++------------- examples/imgui_impl_glfw.h | 16 ++++++++-------- examples/imgui_impl_marmalade.cpp | 12 ++++++------ examples/imgui_impl_marmalade.h | 20 +++++++++---------- examples/imgui_impl_opengl2.h | 16 ++++++++-------- examples/imgui_impl_opengl3.h | 16 ++++++++-------- examples/imgui_impl_sdl.h | 10 +++++----- examples/imgui_impl_vulkan.h | 32 +++++++++++++++---------------- examples/imgui_impl_win32.cpp | 2 +- examples/imgui_impl_win32.h | 8 ++++---- imgui.h | 15 ++++++++++----- 17 files changed, 122 insertions(+), 116 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index eaf6d356..84f03d95 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -84,6 +84,7 @@ Other Changes: - Examples: Allegro5: Added support for ImGuiConfigFlags_NoMouseCursorChange flag. Added clipboard support. - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end. - Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801) + - Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) - Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887) - Misc: Updated stb_textedit from 1.09 + patches to 1.12 + minor patches. - Internals: PushItemFlag() flags are inherited by BeginChild(). diff --git a/examples/imgui_impl_allegro5.h b/examples/imgui_impl_allegro5.h index fbcd72f4..6455a3c6 100644 --- a/examples/imgui_impl_allegro5.h +++ b/examples/imgui_impl_allegro5.h @@ -18,12 +18,12 @@ struct ALLEGRO_DISPLAY; union ALLEGRO_EVENT; -IMGUI_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display); -IMGUI_API void ImGui_ImplAllegro5_Shutdown(); -IMGUI_API void ImGui_ImplAllegro5_NewFrame(); -IMGUI_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); -IMGUI_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); +IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display); +IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); -IMGUI_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); diff --git a/examples/imgui_impl_dx10.h b/examples/imgui_impl_dx10.h index 83924a93..c0e27c60 100644 --- a/examples/imgui_impl_dx10.h +++ b/examples/imgui_impl_dx10.h @@ -11,11 +11,11 @@ struct ID3D10Device; -IMGUI_API bool ImGui_ImplDX10_Init(ID3D10Device* device); -IMGUI_API void ImGui_ImplDX10_Shutdown(); -IMGUI_API void ImGui_ImplDX10_NewFrame(); -IMGUI_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); +IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API void ImGui_ImplDX10_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_ImplDX10_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx11.h b/examples/imgui_impl_dx11.h index bb21e6b6..fef3f31c 100644 --- a/examples/imgui_impl_dx11.h +++ b/examples/imgui_impl_dx11.h @@ -12,11 +12,11 @@ struct ID3D11Device; struct ID3D11DeviceContext; -IMGUI_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); -IMGUI_API void ImGui_ImplDX11_Shutdown(); -IMGUI_API void ImGui_ImplDX11_NewFrame(); -IMGUI_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); +IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_ImplDX11_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx12.h b/examples/imgui_impl_dx12.h index 2af2d595..3826b080 100644 --- a/examples/imgui_impl_dx12.h +++ b/examples/imgui_impl_dx12.h @@ -19,12 +19,12 @@ struct D3D12_GPU_DESCRIPTOR_HANDLE; // Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate // render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle. // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture. -IMGUI_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, - D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); -IMGUI_API void ImGui_ImplDX12_Shutdown(); -IMGUI_API void ImGui_ImplDX12_NewFrame(ID3D12GraphicsCommandList* cmd_list); -IMGUI_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, + D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); +IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(ID3D12GraphicsCommandList* cmd_list); +IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API void ImGui_ImplDX12_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_ImplDX12_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx9.h b/examples/imgui_impl_dx9.h index 52fcbdca..c7ac1c10 100644 --- a/examples/imgui_impl_dx9.h +++ b/examples/imgui_impl_dx9.h @@ -11,11 +11,11 @@ struct IDirect3DDevice9; -IMGUI_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); -IMGUI_API void ImGui_ImplDX9_Shutdown(); -IMGUI_API void ImGui_ImplDX9_NewFrame(); -IMGUI_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); +IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); diff --git a/examples/imgui_impl_freeglut.h b/examples/imgui_impl_freeglut.h index d79cd024..e2b7ca6e 100644 --- a/examples/imgui_impl_freeglut.h +++ b/examples/imgui_impl_freeglut.h @@ -9,19 +9,19 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -IMGUI_API bool ImGui_ImplFreeGLUT_Init(); -IMGUI_API void ImGui_ImplFreeGLUT_InstallFuncs(); -IMGUI_API void ImGui_ImplFreeGLUT_Shutdown(); -IMGUI_API void ImGui_ImplFreeGLUT_NewFrame(); +IMGUI_IMPL_API bool ImGui_ImplFreeGLUT_Init(); +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_InstallFuncs(); +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_NewFrame(); // You can call ImGui_ImplFreeGLUT_InstallFuncs() to get all those functions installed automatically, // or call them yourself from your own GLUT handlers. We are using the same weird names as GLUT for consistency.. -//------------------------------------ GLUT name --------------------------------------------- Decent Name -------------- -IMGUI_API void ImGui_ImplFreeGLUT_ReshapeFunc(int w, int h); // ~ ResizeFunc -IMGUI_API void ImGui_ImplFreeGLUT_MotionFunc(int x, int y); // ~ MouseMoveFunc -IMGUI_API void ImGui_ImplFreeGLUT_MouseFunc(int button, int state, int x, int y); // ~ MouseButtonFunc -IMGUI_API void ImGui_ImplFreeGLUT_MouseWheelFunc(int button, int dir, int x, int y); // ~ MouseWheelFunc -IMGUI_API void ImGui_ImplFreeGLUT_KeyboardFunc(unsigned char c, int x, int y); // ~ CharPressedFunc -IMGUI_API void ImGui_ImplFreeGLUT_KeyboardUpFunc(unsigned char c, int x, int y); // ~ CharReleasedFunc -IMGUI_API void ImGui_ImplFreeGLUT_SpecialFunc(int key, int x, int y); // ~ KeyPressedFunc -IMGUI_API void ImGui_ImplFreeGLUT_SpecialUpFunc(int key, int x, int y); // ~ KeyReleasedFunc +//---------------------------------------- GLUT name --------------------------------------------- Decent Name --------- +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_ReshapeFunc(int w, int h); // ~ ResizeFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_MotionFunc(int x, int y); // ~ MouseMoveFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_MouseFunc(int button, int state, int x, int y); // ~ MouseButtonFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_MouseWheelFunc(int button, int dir, int x, int y); // ~ MouseWheelFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_KeyboardFunc(unsigned char c, int x, int y); // ~ CharPressedFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_KeyboardUpFunc(unsigned char c, int x, int y); // ~ CharReleasedFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_SpecialFunc(int key, int x, int y); // ~ KeyPressedFunc +IMGUI_IMPL_API void ImGui_ImplFreeGLUT_SpecialUpFunc(int key, int x, int y); // ~ KeyReleasedFunc diff --git a/examples/imgui_impl_glfw.h b/examples/imgui_impl_glfw.h index a6557453..b1e3617d 100644 --- a/examples/imgui_impl_glfw.h +++ b/examples/imgui_impl_glfw.h @@ -18,15 +18,15 @@ struct GLFWwindow; -IMGUI_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks); -IMGUI_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks); -IMGUI_API void ImGui_ImplGlfw_Shutdown(); -IMGUI_API void ImGui_ImplGlfw_NewFrame(); +IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks); +IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks); +IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame(); // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) // Provided here if you want to chain callbacks. // You can also handle inputs yourself and use those as a reference. -IMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); -IMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); -IMGUI_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); -IMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); +IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); +IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); +IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); +IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index 5e603597..f7629e2a 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -120,12 +120,12 @@ static void ImGui_Marmalade_SetClipboardText(void* /*user_data*/, const char* te s3eClipboardSetText(text); } -int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserData) +int32 ImGui_Marmalade_PointerButtonEventCallback(void* system_data, void* user_data) { // pEvent->m_Button is of type s3ePointerButton and indicates which mouse // button was pressed. For touchscreen this should always have the value // S3E_POINTER_BUTTON_SELECT - s3ePointerEvent* pEvent = (s3ePointerEvent*)SystemData; + s3ePointerEvent* pEvent = (s3ePointerEvent*)system_data; if (pEvent->m_Pressed == 1) { @@ -144,10 +144,10 @@ int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserDa return 0; } -int32 ImGui_Marmalade_KeyCallback(void* SystemData, void* userData) +int32 ImGui_Marmalade_KeyCallback(void* system_data, void* user_data) { ImGuiIO& io = ImGui::GetIO(); - s3eKeyboardEvent* e = (s3eKeyboardEvent*)SystemData; + s3eKeyboardEvent* e = (s3eKeyboardEvent*)system_data; if (e->m_Pressed == 1) io.KeysDown[e->m_Key] = true; if (e->m_Pressed == 0) @@ -161,10 +161,10 @@ int32 ImGui_Marmalade_KeyCallback(void* SystemData, void* userData) return 0; } -int32 ImGui_Marmalade_CharCallback(void* SystemData, void* userData) +int32 ImGui_Marmalade_CharCallback(void* system_data, void* user_data) { ImGuiIO& io = ImGui::GetIO(); - s3eKeyboardCharEvent* e = (s3eKeyboardCharEvent*)SystemData; + s3eKeyboardCharEvent* e = (s3eKeyboardCharEvent*)system_data; if ((e->m_Char > 0 && e->m_Char < 0x10000)) io.AddInputCharacter((unsigned short)e->m_Char); diff --git a/examples/imgui_impl_marmalade.h b/examples/imgui_impl_marmalade.h index d8e98d58..01b84889 100644 --- a/examples/imgui_impl_marmalade.h +++ b/examples/imgui_impl_marmalade.h @@ -11,17 +11,17 @@ // Copyright (C) 2015 by Giovanni Zito // This file is part of ImGui -IMGUI_API bool ImGui_Marmalade_Init(bool install_callbacks); -IMGUI_API void ImGui_Marmalade_Shutdown(); -IMGUI_API void ImGui_Marmalade_NewFrame(); -IMGUI_API void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_Marmalade_Init(bool install_callbacks); +IMGUI_IMPL_API void ImGui_Marmalade_Shutdown(); +IMGUI_IMPL_API void ImGui_Marmalade_NewFrame(); +IMGUI_IMPL_API void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. -IMGUI_API void ImGui_Marmalade_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_Marmalade_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_Marmalade_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_Marmalade_CreateDeviceObjects(); -// callbacks (installed by default if you enable 'install_callbacks' during initialization) +// Callbacks (installed by default if you enable 'install_callbacks' during initialization) // You can also handle inputs yourself and use those as a reference. -IMGUI_API int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserData); -IMGUI_API int32 ImGui_Marmalade_KeyCallback(void* SystemData, void* userData); -IMGUI_API int32 ImGui_Marmalade_CharCallback(void* SystemData, void* userData); +IMGUI_IMPL_API int32 ImGui_Marmalade_PointerButtonEventCallback(void* system_data, void* user_data); +IMGUI_IMPL_API int32 ImGui_Marmalade_KeyCallback(void* system_data, void* user_data); +IMGUI_IMPL_API int32 ImGui_Marmalade_CharCallback(void* system_data, void* user_data); diff --git a/examples/imgui_impl_opengl2.h b/examples/imgui_impl_opengl2.h index 7da3cfa1..52bcedf9 100644 --- a/examples/imgui_impl_opengl2.h +++ b/examples/imgui_impl_opengl2.h @@ -12,13 +12,13 @@ // confuse your GPU driver. // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. -IMGUI_API bool ImGui_ImplOpenGL2_Init(); -IMGUI_API void ImGui_ImplOpenGL2_Shutdown(); -IMGUI_API void ImGui_ImplOpenGL2_NewFrame(); -IMGUI_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); +IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); // Called by Init/NewFrame/Shutdown -IMGUI_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); -IMGUI_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); -IMGUI_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); -IMGUI_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); +IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); +IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); diff --git a/examples/imgui_impl_opengl3.h b/examples/imgui_impl_opengl3.h index 24bfd6e1..e49ff761 100644 --- a/examples/imgui_impl_opengl3.h +++ b/examples/imgui_impl_opengl3.h @@ -9,13 +9,13 @@ // The 'glsl_version' initialization parameter defaults to "#version 150" if NULL. // Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! -IMGUI_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = "#version 150"); -IMGUI_API void ImGui_ImplOpenGL3_Shutdown(); -IMGUI_API void ImGui_ImplOpenGL3_NewFrame(); -IMGUI_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = "#version 150"); +IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); // Called by Init/NewFrame/Shutdown -IMGUI_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); -IMGUI_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); -IMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); -IMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); +IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); +IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); diff --git a/examples/imgui_impl_sdl.h b/examples/imgui_impl_sdl.h index 5e774f95..f0bc4e9a 100644 --- a/examples/imgui_impl_sdl.h +++ b/examples/imgui_impl_sdl.h @@ -16,8 +16,8 @@ struct SDL_Window; typedef union SDL_Event SDL_Event; -IMGUI_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); -IMGUI_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window); -IMGUI_API void ImGui_ImplSDL2_Shutdown(); -IMGUI_API void ImGui_ImplSDL2_NewFrame(SDL_Window* window); -IMGUI_API bool ImGui_ImplSDL2_ProcessEvent(SDL_Event* event); +IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); +IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window); +IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(SDL_Window* window); +IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(SDL_Event* event); diff --git a/examples/imgui_impl_vulkan.h b/examples/imgui_impl_vulkan.h index 4bdbf83f..e60299aa 100644 --- a/examples/imgui_impl_vulkan.h +++ b/examples/imgui_impl_vulkan.h @@ -26,16 +26,16 @@ struct ImGui_ImplVulkan_InitInfo void (*CheckVkResultFn)(VkResult err); }; -IMGUI_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass); -IMGUI_API void ImGui_ImplVulkan_Shutdown(); -IMGUI_API void ImGui_ImplVulkan_NewFrame(); -IMGUI_API void ImGui_ImplVulkan_RenderDrawData(VkCommandBuffer command_buffer, ImDrawData* draw_data); +IMGUI_IMPL_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass); +IMGUI_IMPL_API void ImGui_ImplVulkan_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplVulkan_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplVulkan_RenderDrawData(VkCommandBuffer command_buffer, ImDrawData* draw_data); // Called by Init/NewFrame/Shutdown -IMGUI_API void ImGui_ImplVulkan_InvalidateFontUploadObjects(); -IMGUI_API void ImGui_ImplVulkan_InvalidateDeviceObjects(); -IMGUI_API bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer); -IMGUI_API bool ImGui_ImplVulkan_CreateDeviceObjects(); +IMGUI_IMPL_API void ImGui_ImplVulkan_InvalidateFontUploadObjects(); +IMGUI_IMPL_API void ImGui_ImplVulkan_InvalidateDeviceObjects(); +IMGUI_IMPL_API bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer); +IMGUI_IMPL_API bool ImGui_ImplVulkan_CreateDeviceObjects(); //------------------------------------------------------------------------- // Miscellaneous Vulkan Helpers @@ -49,12 +49,12 @@ IMGUI_API bool ImGui_ImplVulkan_CreateDeviceObjects(); struct ImGui_ImplVulkanH_FrameData; struct ImGui_ImplVulkanH_WindowData; -IMGUI_API void ImGui_ImplVulkanH_CreateWindowDataCommandBuffers(VkPhysicalDevice physical_device, VkDevice device, uint32_t queue_family, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator); -IMGUI_API void ImGui_ImplVulkanH_CreateWindowDataSwapChainAndFramebuffer(VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator, int w, int h); -IMGUI_API void ImGui_ImplVulkanH_DestroyWindowData(VkInstance instance, VkDevice device, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator); -IMGUI_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkFormat* request_formats, int request_formats_count, VkColorSpaceKHR request_color_space); -IMGUI_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkPresentModeKHR* request_modes, int request_modes_count); -IMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode); +IMGUI_IMPL_API void ImGui_ImplVulkanH_CreateWindowDataCommandBuffers(VkPhysicalDevice physical_device, VkDevice device, uint32_t queue_family, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator); +IMGUI_IMPL_API void ImGui_ImplVulkanH_CreateWindowDataSwapChainAndFramebuffer(VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator, int w, int h); +IMGUI_IMPL_API void ImGui_ImplVulkanH_DestroyWindowData(VkInstance instance, VkDevice device, ImGui_ImplVulkanH_WindowData* wd, const VkAllocationCallbacks* allocator); +IMGUI_IMPL_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkFormat* request_formats, int request_formats_count, VkColorSpaceKHR request_color_space); +IMGUI_IMPL_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkPresentModeKHR* request_modes, int request_modes_count); +IMGUI_IMPL_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode); struct ImGui_ImplVulkanH_FrameData { @@ -65,7 +65,7 @@ struct ImGui_ImplVulkanH_FrameData VkSemaphore ImageAcquiredSemaphore; VkSemaphore RenderCompleteSemaphore; - IMGUI_API ImGui_ImplVulkanH_FrameData(); + IMGUI_IMPL_API ImGui_ImplVulkanH_FrameData(); }; struct ImGui_ImplVulkanH_WindowData @@ -86,6 +86,6 @@ struct ImGui_ImplVulkanH_WindowData uint32_t FrameIndex; ImGui_ImplVulkanH_FrameData Frames[IMGUI_VK_QUEUED_FRAMES]; - IMGUI_API ImGui_ImplVulkanH_WindowData(); + IMGUI_IMPL_API ImGui_ImplVulkanH_WindowData(); }; diff --git a/examples/imgui_impl_win32.cpp b/examples/imgui_impl_win32.cpp index 1b39e068..b966ea32 100644 --- a/examples/imgui_impl_win32.cpp +++ b/examples/imgui_impl_win32.cpp @@ -176,7 +176,7 @@ void ImGui_ImplWin32_NewFrame() // Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags. // PS: In this Win32 handler, we use the capture API (GetCapture/SetCapture/ReleaseCapture) to be able to read mouse coordinations when dragging mouse outside of our window bounds. // PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag. -IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (ImGui::GetCurrentContext() == NULL) return 0; diff --git a/examples/imgui_impl_win32.h b/examples/imgui_impl_win32.h index 71a3d305..98c97d89 100644 --- a/examples/imgui_impl_win32.h +++ b/examples/imgui_impl_win32.h @@ -5,13 +5,13 @@ // [X] Platform: Clipboard support (for Win32 this is actually part of core imgui) // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. -IMGUI_API bool ImGui_ImplWin32_Init(void* hwnd); -IMGUI_API void ImGui_ImplWin32_Shutdown(); -IMGUI_API void ImGui_ImplWin32_NewFrame(); +IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); +IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); // Handler for Win32 messages, update mouse/keyboard data. // You may or not need this for your implementation, but it can serve as reference for handling inputs. // Intentionally commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code. /* -IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); +IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); */ diff --git a/imgui.h b/imgui.h index 4386cc36..c777d69f 100644 --- a/imgui.h +++ b/imgui.h @@ -26,14 +26,18 @@ #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert)) // Define attributes of all API symbols declarations (e.g. for DLL under Windows) +// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default bindings files (imgui_impl_xxx.h) #ifndef IMGUI_API #define IMGUI_API #endif +#ifndef IMGUI_IMPL_API +#define IMGUI_IMPL_API IMGUI_API +#endif // Helpers #ifndef IM_ASSERT -#include -#define IM_ASSERT(_EXPR) assert(_EXPR) +#include +#define IM_ASSERT(_EXPR) assert(_EXPR) // You can override the default assert handler by editing imconfig.h #endif #if defined(__clang__) || defined(__GNUC__) #define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to user functions. @@ -77,6 +81,7 @@ typedef void* ImTextureID; // User data to identify a texture (this is #endif // Typedefs and Enumerations (declared as int for compatibility with old C++ and to not pollute the top of this file) +// Use your programming IDE "Go to definition" facility on the names of the right-most columns to find the actual flags/enum lists. typedef unsigned int ImGuiID; // Unique ID used by widgets (typically hashed from a stack of string) typedef unsigned short ImWchar; // Character for keyboard input/display typedef int ImGuiCol; // enum: a color identifier for styling // enum ImGuiCol_ @@ -116,7 +121,7 @@ typedef signed long long ImS64; // 64-bit signed integer typedef unsigned long long ImU64; // 64-bit unsigned integer #endif -// 2d vector +// 2D vector (often used to store positions, sizes, etc.) struct ImVec2 { float x, y; @@ -128,7 +133,7 @@ struct ImVec2 #endif }; -// 4d vector (often used to store floating-point colors) +// 4D vector (often used to store floating-point colors) struct ImVec4 { float x, y, z, w; @@ -156,9 +161,9 @@ namespace ImGui IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags) IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame. IMGUI_API void NewFrame(); // start a new ImGui frame, you can submit any command from this point until Render()/EndFrame(). + IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), you likely don't need to call that yourself directly. If you don't need to render data (skipping rendering) you may call EndFrame() but you'll have wasted CPU already! If you don't need to render, better to not create any imgui windows and not call NewFrame() at all! IMGUI_API void Render(); // ends the ImGui frame, finalize the draw data. (Obsolete: optionally call io.RenderDrawListsFn if set. Nowadays, prefer calling your render function yourself.) IMGUI_API ImDrawData* GetDrawData(); // valid after Render() and until the next call to NewFrame(). this is what you have to render. (Obsolete: this used to be passed to your io.RenderDrawListsFn() function.) - IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead! // Demo, Debug, Information IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application! From f9a5ff7a19a3cf9770f0dff23030a98885f30a69 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 21 Jun 2018 12:13:04 +0200 Subject: [PATCH 6/8] Examples: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from ImGui_ImplDX12_NewFrame() to ImGui_ImplDX12_RenderDrawData() which makes a lots more sense. (#301) --- CHANGELOG.txt | 1 + examples/example_win32_directx12/main.cpp | 4 +- examples/imgui_impl_dx12.cpp | 51 +++++++++++------------ examples/imgui_impl_dx12.h | 10 +++-- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 84f03d95..d8d55967 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -83,6 +83,7 @@ Other Changes: - Examples: Added SDL+Vulkan example. - Examples: Allegro5: Added support for ImGuiConfigFlags_NoMouseCursorChange flag. Added clipboard support. - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end. + - Examples: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from ImGui_ImplDX12_NewFrame() to ImGui_ImplDX12_RenderDrawData() which makes a lots more sense. (#301) - Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801) - Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) - Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887) diff --git a/examples/example_win32_directx12/main.cpp b/examples/example_win32_directx12/main.cpp index b014b6d8..94dc4a27 100644 --- a/examples/example_win32_directx12/main.cpp +++ b/examples/example_win32_directx12/main.cpp @@ -339,7 +339,7 @@ int main(int, char**) } // Start the ImGui frame - ImGui_ImplDX12_NewFrame(g_pd3dCommandList); + ImGui_ImplDX12_NewFrame(); ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); @@ -399,7 +399,7 @@ int main(int, char**) g_pd3dCommandList->OMSetRenderTargets(1, &g_mainRenderTargetDescriptor[backBufferIdx], FALSE, NULL); g_pd3dCommandList->SetDescriptorHeaps(1, &g_pd3dSrvDescHeap); ImGui::Render(); - ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData()); + ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData(), g_pd3dCommandList); barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_RENDER_TARGET; barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_PRESENT; g_pd3dCommandList->ResourceBarrier(1, &barrier); diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index dcd32e01..15fb7119 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -1,8 +1,10 @@ -// ImGui Win32 + DirectX12 binding -// FIXME: 64-bit only for now! (Because sizeof(ImTextureId) == sizeof(void*)) +// ImGui Renderer for: DirectX12 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. +// Issues: +// [ ] 64-bit only for now! (Because sizeof(ImTextureId) == sizeof(void*)). See github.com/ocornut/imgui/pull/301 // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). @@ -11,6 +13,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2018-06-12: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from NewFrame() to RenderDrawData(). // 2018-06-08: Misc: Extracted imgui_impl_dx12.cpp/.h away from the old combined DX12+Win32 example. // 2018-06-08: DirectX12: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle (to ease support for future multi-viewport). // 2018-02-22: Merged into master with all Win32 code synchronized to other examples. @@ -25,7 +28,6 @@ // DirectX data static ID3D12Device* g_pd3dDevice = NULL; -static ID3D12GraphicsCommandList* g_pd3dCommandList = NULL; static ID3D10Blob* g_pVertexShaderBlob = NULL; static ID3D10Blob* g_pPixelShaderBlob = NULL; static ID3D12RootSignature* g_pRootSignature = NULL; @@ -53,7 +55,7 @@ struct VERTEX_CONSTANT_BUFFER // Render function // (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop) -void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data) +void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* ctx) { // FIXME: I'm assuming that this only gets called once per frame! // If not, we can't just re-allocate the IB or VB, we'll have to do a proper allocator. @@ -63,7 +65,6 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data) ID3D12Resource* g_pIB = frameResources->IB; int g_VertexBufferSize = frameResources->VertexBufferSize; int g_IndexBufferSize = frameResources->IndexBufferSize; - ID3D12GraphicsCommandList* ctx = g_pd3dCommandList; // Create and grow vertex/index buffers if needed if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount) @@ -453,29 +454,29 @@ bool ImGui_ImplDX12_CreateDeviceObjects() static const char* vertexShader = "cbuffer vertexBuffer : register(b0) \ {\ - float4x4 ProjectionMatrix; \ + float4x4 ProjectionMatrix; \ };\ struct VS_INPUT\ {\ - float2 pos : POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ + float2 pos : POSITION;\ + float4 col : COLOR0;\ + float2 uv : TEXCOORD0;\ };\ \ struct PS_INPUT\ {\ - float4 pos : SV_POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ + float4 pos : SV_POSITION;\ + float4 col : COLOR0;\ + float2 uv : TEXCOORD0;\ };\ \ PS_INPUT main(VS_INPUT input)\ {\ - PS_INPUT output;\ - output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\ - output.col = input.col;\ - output.uv = input.uv;\ - return output;\ + PS_INPUT output;\ + output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\ + output.col = input.col;\ + output.uv = input.uv;\ + return output;\ }"; D3DCompile(vertexShader, strlen(vertexShader), NULL, NULL, NULL, "main", "vs_5_0", 0, 0, &g_pVertexShaderBlob, NULL); @@ -497,17 +498,17 @@ bool ImGui_ImplDX12_CreateDeviceObjects() static const char* pixelShader = "struct PS_INPUT\ {\ - float4 pos : SV_POSITION;\ - float4 col : COLOR0;\ - float2 uv : TEXCOORD0;\ + float4 pos : SV_POSITION;\ + float4 col : COLOR0;\ + float2 uv : TEXCOORD0;\ };\ SamplerState sampler0 : register(s0);\ Texture2D texture0 : register(t0);\ \ float4 main(PS_INPUT input) : SV_Target\ {\ - float4 out_col = input.col * texture0.Sample(sampler0, input.uv); \ - return out_col; \ + float4 out_col = input.col * texture0.Sample(sampler0, input.uv); \ + return out_col; \ }"; D3DCompile(pixelShader, strlen(pixelShader), NULL, NULL, NULL, "main", "ps_5_0", 0, 0, &g_pPixelShaderBlob, NULL); @@ -594,6 +595,7 @@ bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FO g_numFramesInFlight = num_frames_in_flight; g_frameIndex = UINT_MAX; + // Create buffers with a default size (they will later be grown as needed) for (int i = 0; i < num_frames_in_flight; i++) { g_pFrameResources[i].IB = NULL; @@ -610,7 +612,6 @@ void ImGui_ImplDX12_Shutdown() ImGui_ImplDX12_InvalidateDeviceObjects(); delete[] g_pFrameResources; g_pd3dDevice = NULL; - g_pd3dCommandList = NULL; g_hFontSrvCpuDescHandle.ptr = 0; g_hFontSrvGpuDescHandle.ptr = 0; g_pFrameResources = NULL; @@ -618,10 +619,8 @@ void ImGui_ImplDX12_Shutdown() g_frameIndex = UINT_MAX; } -void ImGui_ImplDX12_NewFrame(ID3D12GraphicsCommandList* command_list) +void ImGui_ImplDX12_NewFrame() { if (!g_pPipelineState) ImGui_ImplDX12_CreateDeviceObjects(); - - g_pd3dCommandList = command_list; } diff --git a/examples/imgui_impl_dx12.h b/examples/imgui_impl_dx12.h index 3826b080..2f70f960 100644 --- a/examples/imgui_impl_dx12.h +++ b/examples/imgui_impl_dx12.h @@ -1,8 +1,10 @@ -// ImGui Win32 + DirectX12 binding -// FIXME: 64-bit only for now! (Because sizeof(ImTextureId) == sizeof(void*)) +// ImGui Renderer for: DirectX12 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. +// Issues: +// [ ] 64-bit only for now! (Because sizeof(ImTextureId) == sizeof(void*)). See github.com/ocornut/imgui/pull/301 // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). @@ -22,8 +24,8 @@ struct D3D12_GPU_DESCRIPTOR_HANDLE; IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); -IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(ID3D12GraphicsCommandList* cmd_list); -IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data); +IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); +IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); // Use if you want to reset your rendering device without losing ImGui state. IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); From 1b74e3be0262c7404eae4b8a514844ed6bc92659 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 22 Jun 2018 09:41:25 +0200 Subject: [PATCH 7/8] Version 1.62 --- CHANGELOG.txt | 12 ++++++------ imgui.cpp | 4 ++-- imgui.h | 4 ++-- imgui_demo.cpp | 2 +- imgui_draw.cpp | 2 +- imgui_internal.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d8d55967..849c2e5a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -30,16 +30,16 @@ HOW TO UPDATE? ----------------------------------------------------------------------- - VERSION 1.62 WIP (IN PROGRESS) + VERSION 1.62 (Released 2018-06-22) ----------------------------------------------------------------------- Breaking Changes: - TreeNodeEx(): The helper ImGuiTreeNodeFlags_CollapsingHeader flag now include ImGuiTreeNodeFlags_NoTreePushOnOpen. The flag was already set by CollapsingHeader(). - The only difference is if you were using TreeNodeEx() manually with ImGuiTreeNodeFlags_CollapsingHeader and without ImGuiTreeNodeFlags_NoTreePushOnOpen. In which case - you can remove the ImGuiTreeNodeFlags_NoTreePushOnOpen flag from your call (ImGuiTreeNodeFlags_CollapsingHeader & ~ImGuiTreeNodeFlags_NoTreePushOnOpen). (#1864) - - ImFontAtlas: Renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set. (#1859) + The only difference is if you were using TreeNodeEx() manually with ImGuiTreeNodeFlags_CollapsingHeader and without ImGuiTreeNodeFlags_NoTreePushOnOpen. + In this case you can remove the ImGuiTreeNodeFlags_NoTreePushOnOpen flag from your call (ImGuiTreeNodeFlags_CollapsingHeader & ~ImGuiTreeNodeFlags_NoTreePushOnOpen). (#1864) This also apply if you were using internal's TreeNodeBehavior() with the ImGuiTreeNodeFlags_CollapsingHeader flag directly. + - ImFontAtlas: Renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish new smaller variants and discourage using the full set. (#1859) Other Changes: @@ -80,9 +80,9 @@ Other Changes: - ImFontAtlas: Added GetGlyphRangesChineseSimplifiedCommon() helper that returns a list of ~2500 most common Simplified Chinese characters. (#1859) [@JX-Master, @ocornut] - Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000] - Examples: Win32: Fixed handling of mouse wheel messages to support sub-unit scrolling messages (typically sent by track-pads). (#1874) [@zx64] - - Examples: Added SDL+Vulkan example. + - Examples: SDL+Vulkan: Added SDL+Vulkan example. - Examples: Allegro5: Added support for ImGuiConfigFlags_NoMouseCursorChange flag. Added clipboard support. - - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end. + - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end (will be fixed in Allegro 5.2.5+). - Examples: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from ImGui_ImplDX12_NewFrame() to ImGui_ImplDX12_RenderDrawData() which makes a lots more sense. (#301) - Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801) - Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) diff --git a/imgui.cpp b/imgui.cpp index 2cdc1900..0148099d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.62 WIP +// dear imgui, v1.62 // (main code and documentation) // Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. @@ -266,7 +266,7 @@ You can read releases logs https://github.com/ocornut/imgui/releases for more details. - 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set. - - 2018/06/06 (1.62) - TreeNodeEx(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details. + - 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details. - 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more. If you used DragInt() with custom format strings, make sure you change them to use %d or an integer-compatible format. To honor backward-compatibility, the DragInt() code will currently parse and modify format strings to replace %*f with %d, giving time to users to upgrade their code. diff --git a/imgui.h b/imgui.h index c777d69f..1e0de67e 100644 --- a/imgui.h +++ b/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.62 WIP +// dear imgui, v1.62 // (headers) // See imgui.cpp file for documentation. @@ -22,7 +22,7 @@ #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp // Version -#define IMGUI_VERSION "1.62 WIP" +#define IMGUI_VERSION "1.62" #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert)) // Define attributes of all API symbols declarations (e.g. for DLL under Windows) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index a2d555ff..8c31ea03 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.62 WIP +// dear imgui, v1.62 // (demo code) // Message to the person tempted to delete this file when integrating ImGui into their code base: diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 093b8da6..1945ed09 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.62 WIP +// dear imgui, v1.62 // (drawing and font code) // Contains implementation for diff --git a/imgui_internal.h b/imgui_internal.h index cc9d16c9..bd129ae6 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.62 WIP +// dear imgui, v1.62 // (internals) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! From d68633398b70cc87789ea16b2f1ca0f41195f612 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 22 Jun 2018 10:02:02 +0200 Subject: [PATCH 8/8] Examples: Vulkan: nverted the parameters to ImGui_ImplVulkan_RenderDrawData() to be consistent with other bindings. --- CHANGELOG.txt | 1 + examples/example_glfw_vulkan/main.cpp | 2 +- examples/example_sdl_vulkan/main.cpp | 2 +- examples/imgui_impl_vulkan.cpp | 6 ++++-- examples/imgui_impl_vulkan.h | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 849c2e5a..39bcfa50 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -84,6 +84,7 @@ Other Changes: - Examples: Allegro5: Added support for ImGuiConfigFlags_NoMouseCursorChange flag. Added clipboard support. - Examples: Allegro5: Unindexing buffers ourselves as Allegro indexed drawing primitives are buggy in the DirectX9 back-end (will be fixed in Allegro 5.2.5+). - Examples: DirectX12: Moved the ID3D12GraphicsCommandList* parameter from ImGui_ImplDX12_NewFrame() to ImGui_ImplDX12_RenderDrawData() which makes a lots more sense. (#301) + - Examples: Vulkan: Reordered parameters ImGui_ImplVulkan_RenderDrawData() to be consistent with other bindings, a good occasion since we refactored the code. - Examples: FreeGLUT: Added FreeGLUT bindings. Added FreeGLUT+OpenGL2 example. (#801) - Examples: The functions in imgui_impl_xxx.cpp are prefixed with IMGUI_IMPL_API (which defaults to IMGUI_API) to facilitate some uses. (#1888) - Examples: Fixed bindings to use ImGuiMouseCursor_COUNT instead of old name ImGuiMouseCursor_Count_ so they can compile with IMGUI_DISABLE_OBSOLETE_FUNCTIONS. (#1887) diff --git a/examples/example_glfw_vulkan/main.cpp b/examples/example_glfw_vulkan/main.cpp index 600c82d1..8c5d995d 100644 --- a/examples/example_glfw_vulkan/main.cpp +++ b/examples/example_glfw_vulkan/main.cpp @@ -261,7 +261,7 @@ static void FrameRender(ImGui_ImplVulkanH_WindowData* wd) } // Record Imgui Draw Data and draw funcs into command buffer - ImGui_ImplVulkan_RenderDrawData(fd->CommandBuffer, ImGui::GetDrawData()); + ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), fd->CommandBuffer); // Submit command buffer vkCmdEndRenderPass(fd->CommandBuffer); diff --git a/examples/example_sdl_vulkan/main.cpp b/examples/example_sdl_vulkan/main.cpp index 2b8b104f..86e3ece1 100644 --- a/examples/example_sdl_vulkan/main.cpp +++ b/examples/example_sdl_vulkan/main.cpp @@ -258,7 +258,7 @@ static void FrameRender(ImGui_ImplVulkanH_WindowData* wd) } // Record Imgui Draw Data and draw funcs into command buffer - ImGui_ImplVulkan_RenderDrawData(fd->CommandBuffer, ImGui::GetDrawData()); + ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), fd->CommandBuffer); // Submit command buffer vkCmdEndRenderPass(fd->CommandBuffer); diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp index 468f10c3..bed7d382 100644 --- a/examples/imgui_impl_vulkan.cpp +++ b/examples/imgui_impl_vulkan.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2018-06-22: Inverted the parameters to ImGui_ImplVulkan_RenderDrawData() to be consistent with other bindings. // 2018-06-08: Misc: Extracted imgui_impl_vulkan.cpp/.h away from the old combined GLFW+Vulkan example. // 2018-06-08: Vulkan: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle. // 2018-03-03: Vulkan: Various refactor, created a couple of ImGui_ImplVulkanH_XXX helper that the example can use and that viewport support will use. @@ -193,8 +194,9 @@ static void CreateOrResizeBuffer(VkBuffer& buffer, VkDeviceMemory& buffer_memory p_buffer_size = new_size; } -// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure) -void ImGui_ImplVulkan_RenderDrawData(VkCommandBuffer command_buffer, ImDrawData* draw_data) +// Render function +// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop) +void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer) { VkResult err; if (draw_data->TotalVtxCount == 0) diff --git a/examples/imgui_impl_vulkan.h b/examples/imgui_impl_vulkan.h index e60299aa..5a9fd5d4 100644 --- a/examples/imgui_impl_vulkan.h +++ b/examples/imgui_impl_vulkan.h @@ -29,7 +29,7 @@ struct ImGui_ImplVulkan_InitInfo IMGUI_IMPL_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass); IMGUI_IMPL_API void ImGui_ImplVulkan_Shutdown(); IMGUI_IMPL_API void ImGui_ImplVulkan_NewFrame(); -IMGUI_IMPL_API void ImGui_ImplVulkan_RenderDrawData(VkCommandBuffer command_buffer, ImDrawData* draw_data); +IMGUI_IMPL_API void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer); // Called by Init/NewFrame/Shutdown IMGUI_IMPL_API void ImGui_ImplVulkan_InvalidateFontUploadObjects();