Skip to content

Commit

Permalink
AbstractRunner: disable test engine pref if not compiled with test en…
Browse files Browse the repository at this point in the history
…gine
  • Loading branch information
pthom committed Nov 23, 2024
1 parent ece8a49 commit 0542026
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/hello_imgui/internal/backend_impls/abstract_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void AbstractRunner::InitImGuiContext()
#endif
}

void AbstractRunner::SetImGuiPrefs()
void AbstractRunner::CheckPrefs()
{
if (params.imGuiWindowParams.enableViewports)
{
Expand All @@ -549,6 +549,14 @@ void AbstractRunner::SetImGuiPrefs()
#else
ImGui::GetIO().IniFilename = "";
#endif

#ifndef IMGUI_BUNDLE_WITH_TEST_ENGINE
if (params.useImGuiTestEngine)
{
fprintf(stderr, "HelloImGui: RunnerParam.useImGuiTestEngine is true, but HelloImGui was not built with support for ImGui Test Engine. Disabling!\n");
params.useImGuiTestEngine = false;
}
#endif
}


Expand Down Expand Up @@ -684,7 +692,7 @@ void AbstractRunner::Setup()
InitRenderBackendCallbacks();

InitImGuiContext();
SetImGuiPrefs();
CheckPrefs();

// Init platform backend (SDL, Glfw)
Impl_InitPlatformBackend();
Expand Down
2 changes: 1 addition & 1 deletion src/hello_imgui/internal/backend_impls/abstract_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class AbstractRunner
private:
void RenderGui();
void InitImGuiContext();
void SetImGuiPrefs();
void CheckPrefs();
void InitRenderBackendCallbacks();

void SetupDpiAwareParams();
Expand Down

0 comments on commit 0542026

Please sign in to comment.