Skip to content

Commit 95fe86a

Browse files
committed
sokol: Fix opening imgui mid-game without cmdline arg
1 parent 68abb97 commit 95fe86a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Source/Render/sokol/SokolRender.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres
261261
sg_setup(&desc);
262262
printf("cSokolRender::Init sg_setup done\n");
263263

264+
const simgui_desc_t simgui_desc = {};
265+
simgui_setup(&simgui_desc);
264266
debugUIEnabled = false;
265267
const char* debugUIArg = check_command_line("render_debug");
266268
if (debugUIArg != nullptr && debugUIArg[0]) {

Source/Render/sokol/SokolRenderState.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ void cSokolRender::DebugUISetEnable(bool state) {
414414

415415
//If enabled and imgui_state isn't initialized, do it
416416
if (debugUIEnabled && imgui_state == nullptr) {
417-
const simgui_desc_t simgui_desc = {};
418-
simgui_setup(&simgui_desc);
419417
const sgimgui_desc_t sgimgui_desc = {};
420418
imgui_state = new sgimgui_t {};
421419
sgimgui_init(imgui_state, &sgimgui_desc);

0 commit comments

Comments
 (0)