From 10e13dd6bb90d2afac906a42f000f9065e2465fa Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 3 Dec 2018 12:19:23 +0100 Subject: [PATCH 1/4] Version 1.67 WIP (again, this time IMGUI_VERSION_NUM has leeway for another hot-fix). --- docs/CHANGELOG.txt | 9 +++++++++ imgui.cpp | 2 +- imgui.h | 2 +- imgui_demo.cpp | 2 +- imgui_draw.cpp | 2 +- imgui_internal.h | 2 +- imgui_widgets.cpp | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index cc084e7c..92bc9aca 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -29,6 +29,15 @@ HOW TO UPDATE? - Please report any issue! +----------------------------------------------------------------------- + VERSION 1.67 (In Progress) +----------------------------------------------------------------------- + +Breaking Changes: + +Other Changes: + + ----------------------------------------------------------------------- VERSION 1.66b (Released 2018-12-01) ----------------------------------------------------------------------- diff --git a/imgui.cpp b/imgui.cpp index b1436391..d809cfb6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (main code and documentation) // Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code. diff --git a/imgui.h b/imgui.h index 39fc616d..203eadf7 100644 --- a/imgui.h +++ b/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (headers) // See imgui.cpp file for documentation. diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 41483b38..b71d6262 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (demo code) // Message to the person tempted to delete this file when integrating Dear ImGui into their code base: diff --git a/imgui_draw.cpp b/imgui_draw.cpp index ef154306..5346ad51 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (drawing and font code) /* diff --git a/imgui_internal.h b/imgui_internal.h index b3f107df..0039d271 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (internal structures/api) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 95a30376..792d80f0 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.66b +// dear imgui, v1.67 WIP // (widgets code) /* From 8d58055a5433e1227ebb5e3b8dba80bb00cc239a Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 3 Dec 2018 17:47:10 +0100 Subject: [PATCH 2/4] Examples: DirectX10/11/12: Made imgui_impl_dx10/dx11/dx12.cpp link d3dcompiler.lib from the .cpp file to ease integration. --- docs/CHANGELOG.txt | 2 ++ examples/imgui_impl_dx10.cpp | 4 ++++ examples/imgui_impl_dx11.cpp | 4 ++++ examples/imgui_impl_dx12.cpp | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 92bc9aca..7ca7f6b8 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -36,6 +36,8 @@ HOW TO UPDATE? Breaking Changes: Other Changes: +- Examples: DirectX10/11/12: Made imgui_impl_dx10/dx11/dx12.cpp link d3dcompiler.lib from the .cpp file + to ease integration. ----------------------------------------------------------------------- diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index f394d61b..ed28f3de 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -10,6 +10,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. // 2018-07-13: DirectX10: Fixed unreleased resources in Init and Shutdown functions. // 2018-06-08: Misc: Extracted imgui_impl_dx10.cpp/.h away from the old combined DX10+Win32 example. @@ -27,6 +28,9 @@ #include #include #include +#ifdef _MSC_VER +#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below. +#endif // DirectX data static ID3D10Device* g_pd3dDevice = NULL; diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index eaef797b..6fd36d62 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -10,6 +10,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. // 2018-08-01: DirectX11: Querying for IDXGIFactory instead of IDXGIFactory1 to increase compatibility. // 2018-07-13: DirectX11: Fixed unreleased resources in Init and Shutdown functions. @@ -26,6 +27,9 @@ #include #include #include +#ifdef _MSC_VER +#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below. +#endif // DirectX data static ID3D11Device* g_pd3dDevice = NULL; diff --git a/examples/imgui_impl_dx12.cpp b/examples/imgui_impl_dx12.cpp index 46d0b8f3..490d9e65 100644 --- a/examples/imgui_impl_dx12.cpp +++ b/examples/imgui_impl_dx12.cpp @@ -12,6 +12,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2018-12-03: Misc: Added #pragma comment statement to automatically link with d3dcompiler.lib when using D3DCompile(). // 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window. // 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. @@ -25,6 +26,9 @@ #include #include #include +#ifdef _MSC_VER +#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below. +#endif // DirectX data static ID3D12Device* g_pd3dDevice = NULL; From eb311abc92b3c4b18a6b680a5a87f5b53d960b08 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 3 Dec 2018 17:49:38 +0100 Subject: [PATCH 3/4] Fixed IMGUI_API tag on ImFontAtlas::IsBuilt() preventing to build as DLL on some setups. (#2226) --- imgui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.h b/imgui.h index 203eadf7..8e695c5f 100644 --- a/imgui.h +++ b/imgui.h @@ -1903,9 +1903,9 @@ struct ImFontAtlas // Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into // the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste. IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions. - IMGUI_API bool IsBuilt() { return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); } IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel + bool IsBuilt() { return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); } void SetTexID(ImTextureID id) { TexID = id; } //------------------------------------------- From fb6ef8b1db8bb281195475743577b75225d00160 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 3 Dec 2018 18:17:50 +0100 Subject: [PATCH 4/4] Comments, tweak --- imgui.cpp | 5 +++-- imgui_demo.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index d809cfb6..76e66d6e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3299,8 +3299,9 @@ void ImGui::NewFrame() g.CurrentPopupStack.resize(0); ClosePopupsOverWindow(g.NavWindow); - // Create implicit window - we will only render it if the user has added something to it. + // Create implicit/fallback window - which we will only render it if the user has added something to it. // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags. + // This fallback is particularly important as it avoid ImGui:: calls from crashing. SetNextWindowSize(ImVec2(400,400), ImGuiCond_FirstUseEver); Begin("Debug##Default"); @@ -4455,7 +4456,7 @@ static void ImGui::UpdateManualResize(ImGuiWindow* window, const ImVec2& size_au ImGuiWindowFlags flags = window->Flags; if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) return; - if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implicit Debug window. + if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implicit/fallback Debug window. return; const int resize_border_count = g.IO.ConfigResizeWindowsFromEdges ? 4 : 0; diff --git a/imgui_demo.cpp b/imgui_demo.cpp index b71d6262..1571bda1 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -199,7 +199,7 @@ void ImGui::ShowDemoWindow(bool* p_open) if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); } if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); } - if (show_app_about) { ShowAboutWindow(&show_app_about); } + if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); } // Demonstrate the various window flags. Typically you would just use the default! static bool no_titlebar = false; @@ -2459,7 +2459,7 @@ static void ShowDemoWindowMisc() void ImGui::ShowAboutWindow(bool* p_open) { ImGui::Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize); - ImGui::Text("Dear ImGui, %s", ImGui::GetVersion()); + ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); ImGui::Separator(); ImGui::Text("By Omar Cornut and all dear imgui contributors."); ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");