From 627d85b90bf833ff24de65f79903637951fc7a16 Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Fri, 3 Dec 2021 21:59:31 +0100 Subject: [PATCH] Fixed DearIMGUI debug assert - missing EndFrame() --- source/main/gui/imgui/OgreImGui.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/main/gui/imgui/OgreImGui.cpp b/source/main/gui/imgui/OgreImGui.cpp index 66d8f18b17..3403ea9dac 100644 --- a/source/main/gui/imgui/OgreImGui.cpp +++ b/source/main/gui/imgui/OgreImGui.cpp @@ -137,11 +137,18 @@ void OgreImGui::renderQueueStarted(Ogre::uint8 queueGroupId, Ogre::Viewport* vp = Ogre::Root::getSingletonPtr()->getRenderSystem()->_getViewport(); if(vp != NULL) { - Ogre::SceneManager* sceneMgr = vp->getCamera()->getSceneManager(); - if (vp->getOverlaysEnabled() && sceneMgr->_getCurrentRenderStage() != Ogre::SceneManager::IRS_RENDER_TO_TEXTURE) + if (vp->getOverlaysEnabled()) { - //ORIG//Ogre::OverlayManager::getSingleton()._queueOverlaysForRendering(vp->getCamera(), sceneMgr->getRenderQueue(), vp); - m_imgui_overlay->_findVisibleObjects(vp->getCamera(), sceneMgr->getRenderQueue(), vp); + Ogre::SceneManager* sceneMgr = vp->getCamera()->getSceneManager(); + if (sceneMgr->_getCurrentRenderStage() != Ogre::SceneManager::IRS_RENDER_TO_TEXTURE) + { + //ORIG//Ogre::OverlayManager::getSingleton()._queueOverlaysForRendering(vp->getCamera(), sceneMgr->getRenderQueue(), vp); + m_imgui_overlay->_findVisibleObjects(vp->getCamera(), sceneMgr->getRenderQueue(), vp); + } + } + else + { + ImGui::EndFrame(); // Rendering won't happen - end frame manually. } } }