Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion code/framework/src/external/imgui/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ namespace Framework::External::ImGUI {
if (!isContextInitialized) {
return;
}
// Cleared before teardown, not after: the backends and the context go away
// below, so anything gated on this flag must already see "not initialized".
isContextInitialized = false;

switch (_config.renderBackend) {
case Graphics::RendererBackend::BACKEND_D3D_9: {
Expand All @@ -152,7 +155,6 @@ namespace Framework::External::ImGUI {

ImGui::DestroyContext();

isContextInitialized = false;
Lifecycle::Shutdown();
}

Expand Down Expand Up @@ -255,6 +257,10 @@ namespace Framework::External::ImGUI {
}

void Wrapper::ShowCursor(bool show) {
// Reachable from teardown paths after Shutdown() or a failed Init().
if (!isContextInitialized) {
return;
}
ImGuiIO &io = ImGui::GetIO();
io.MouseDrawCursor = show;
}
Expand Down
Loading