TestEngine: Added hook to notify test engine of a removed imgui context.

This commit is contained in:
omar 2020-06-29 20:10:59 +02:00
parent 9418dcb693
commit dca7c3c629
3 changed files with 7 additions and 2 deletions

View File

@ -3916,6 +3916,11 @@ void ImGui::Shutdown(ImGuiContext* context)
SetCurrentContext(backup_context); SetCurrentContext(backup_context);
} }
// Notify hooked test engine, if any
#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiTestEngineHook_Shutdown(context);
#endif
// Clear everything else // Clear everything else
for (int i = 0; i < g.Windows.Size; i++) for (int i = 0; i < g.Windows.Size; i++)
IM_DELETE(g.Windows[i]); IM_DELETE(g.Windows[i]);

View File

@ -60,7 +60,7 @@ Index of this file:
// Version // 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) // (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 "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 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) // Define attributes of all API symbols declarations (e.g. for DLL under Windows)

View File

@ -2028,8 +2028,8 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned ch
// [SECTION] Test Engine Hooks (imgui_test_engine) // [SECTION] Test Engine Hooks (imgui_test_engine)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//#define IMGUI_ENABLE_TEST_ENGINE
#ifdef IMGUI_ENABLE_TEST_ENGINE #ifdef IMGUI_ENABLE_TEST_ENGINE
extern void ImGuiTestEngineHook_Shutdown(ImGuiContext* ctx);
extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx); extern void ImGuiTestEngineHook_PreNewFrame(ImGuiContext* ctx);
extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx); extern void ImGuiTestEngineHook_PostNewFrame(ImGuiContext* ctx);
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id); extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);