From dca7c3c62975b893fde1c65f3d8f43bb476bc381 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 29 Jun 2020 20:10:59 +0200 Subject: [PATCH] TestEngine: Added hook to notify test engine of a removed imgui context. --- imgui.cpp | 5 +++++ imgui.h | 2 +- imgui_internal.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 2b5983a38..176326edc 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3916,6 +3916,11 @@ void ImGui::Shutdown(ImGuiContext* context) SetCurrentContext(backup_context); } + // Notify hooked test engine, if any +#ifdef IMGUI_ENABLE_TEST_ENGINE + ImGuiTestEngineHook_Shutdown(context); +#endif + // Clear everything else for (int i = 0; i < g.Windows.Size; i++) IM_DELETE(g.Windows[i]); diff --git a/imgui.h b/imgui.h index 3751f2e3b..9c926c86f 100644 --- a/imgui.h +++ b/imgui.h @@ -60,7 +60,7 @@ Index of this file: // Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) #define IMGUI_VERSION "1.77" -#define IMGUI_VERSION_NUM 17700 +#define IMGUI_VERSION_NUM 17701 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) // Define attributes of all API symbols declarations (e.g. for DLL under Windows) diff --git a/imgui_internal.h b/imgui_internal.h index dd61fea6e..01a7a82ca 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -2028,8 +2028,8 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned ch // [SECTION] Test Engine Hooks (imgui_test_engine) //----------------------------------------------------------------------------- -//#define IMGUI_ENABLE_TEST_ENGINE #ifdef IMGUI_ENABLE_TEST_ENGINE +extern void ImGuiTestEngineHook_Shutdown(ImGuiContext* ctx); extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx); extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx); extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);