mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-20 11:03:09 +00:00
Fix ImGui assertion when starting into DOOMEdit (+editor)
D3::ImGuiHooks::NewFrame() was still called every frame, but EndFrame() wasn't because idSessionLocal::UpdateScreen() exited early. This caused an assertion in Dear ImGui, because it doesn't like calling NewFrame() if it has been called before without EndFrame() afterwards
This commit is contained in:
parent
2d068377ae
commit
46052a9526
1 changed files with 8 additions and 0 deletions
|
@ -307,6 +307,14 @@ void Shutdown()
|
|||
// => ProcessEvent() has already been called (probably multiple times)
|
||||
void NewFrame()
|
||||
{
|
||||
// it can happen that NewFrame() is called without EndFrame() having been called
|
||||
// after the last NewFrame() call, for example when D3Radiant is active and in
|
||||
// idSessionLocal::UpdateScreen() Sys_IsWindowVisible() returns false.
|
||||
// In that case, end the previous frame here so it's ended at all.
|
||||
if ( haveNewFrame ) {
|
||||
EndFrame();
|
||||
}
|
||||
|
||||
// even if all windows are closed, still run a few frames
|
||||
// so ImGui also recognizes internally that all windows are closed
|
||||
// and e.g. ImGuiCond_Appearing works as intended
|
||||
|
|
Loading…
Reference in a new issue