Skip to content

Commit

Permalink
TestEngine: exposed ImGuiTestEngine_BindImGuiContext()/ImGuiTestEngin…
Browse files Browse the repository at this point in the history
…e_UnbindImGuiContext() in imgui_te_internal.h (#67)
  • Loading branch information
ocornut committed Jan 23, 2025
1 parent 8e06a65 commit c5e617c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions imgui_test_engine/imgui_te_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static ImGuiTestEngine* GImGuiTestEngine = nullptr;
//-------------------------------------------------------------------------

// Private functions
static void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
static void ImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
static void ImGuiTestEngine_CoroutineStopAndJoin(ImGuiTestEngine* engine);
static void ImGuiTestEngine_ClearInput(ImGuiTestEngine* engine);
static void ImGuiTestEngine_ApplyInputToImGuiContext(ImGuiTestEngine* engine);
Expand Down Expand Up @@ -140,7 +138,7 @@ static void ImGuiTestEngine_PreEndFrameHook(ImGuiContext* ui_ctx, ImGuiContextHo
static void ImGuiTestEngine_PreRenderHook(ImGuiContext* ui_ctx, ImGuiContextHook* hook) { ImGuiTestEngine_PreRender((ImGuiTestEngine*)hook->UserData, ui_ctx); }
static void ImGuiTestEngine_PostRenderHook(ImGuiContext* ui_ctx, ImGuiContextHook* hook) { ImGuiTestEngine_PostRender((ImGuiTestEngine*)hook->UserData, ui_ctx); }

static void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx)
void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx)
{
IM_ASSERT(engine->UiContextTarget == ui_ctx);

Expand Down Expand Up @@ -196,7 +194,7 @@ static void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiConte
ui_ctx->TestEngine = engine;
}

static void ImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx)
void ImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx)
{
IM_ASSERT(engine->UiContextTarget == ui_ctx);

Expand Down
3 changes: 3 additions & 0 deletions imgui_test_engine/imgui_te_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ int ImGuiTestEngine_GetFrameCount(ImGuiTestEngine* engine);
bool ImGuiTestEngine_PassFilter(ImGuiTest* test, const char* filter);
void ImGuiTestEngine_RunTest(ImGuiTestEngine* engine, ImGuiTestContext* ctx, ImGuiTest* test, ImGuiTestRunFlags run_flags);

void ImGuiTestEngine_BindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);
void ImGuiTestEngine_UnbindImGuiContext(ImGuiTestEngine* engine, ImGuiContext* ui_ctx);

void ImGuiTestEngine_RebootUiContext(ImGuiTestEngine* engine);
ImGuiPerfTool* ImGuiTestEngine_GetPerfTool(ImGuiTestEngine* engine);
void ImGuiTestEngine_UpdateTestsSourceLines(ImGuiTestEngine* engine);
Expand Down

0 comments on commit c5e617c

Please sign in to comment.