[OpenGL] Restore ImGui's context to previously saved one, duh

This commit is contained in:
jackun 2020-03-29 01:54:57 +02:00
parent 6eb2c9bc09
commit 5afbe10005
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

View File

@ -116,6 +116,7 @@ void imgui_create(void *ctx)
init_gpu_stats(vendorID, params);
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGuiContext *saved_ctx = ImGui::GetCurrentContext();
state.imgui_ctx = ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
@ -156,8 +157,8 @@ void imgui_create(void *ctx)
}
sw_stats.font1 = state.font1;
// Reset global context to null, might clash with apps that use Dear ImGui
ImGui::SetCurrentContext(nullptr);
// Restore global context or ours might clash with apps that use Dear ImGui
ImGui::SetCurrentContext(saved_ctx);
}
void imgui_shutdown()