Skip to content

Commit

Permalink
sokol: Fix opening imgui mid-game without cmdline arg
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Nov 1, 2024
1 parent 68abb97 commit 95fe86a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/Render/sokol/SokolRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres
sg_setup(&desc);
printf("cSokolRender::Init sg_setup done\n");

const simgui_desc_t simgui_desc = {};
simgui_setup(&simgui_desc);
debugUIEnabled = false;
const char* debugUIArg = check_command_line("render_debug");
if (debugUIArg != nullptr && debugUIArg[0]) {
Expand Down
2 changes: 0 additions & 2 deletions Source/Render/sokol/SokolRenderState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,6 @@ void cSokolRender::DebugUISetEnable(bool state) {

//If enabled and imgui_state isn't initialized, do it
if (debugUIEnabled && imgui_state == nullptr) {
const simgui_desc_t simgui_desc = {};
simgui_setup(&simgui_desc);
const sgimgui_desc_t sgimgui_desc = {};
imgui_state = new sgimgui_t {};
sgimgui_init(imgui_state, &sgimgui_desc);
Expand Down

0 comments on commit 95fe86a

Please sign in to comment.