void pymms::gui::GUIWindowManager::unregisterWindow(GUIWindow* pWindow) { ost::MutexLock lock(m_windowManagerLock); Render* pRenderer = S_Render::get_instance(); for (std::vector<GUIWindow*>::iterator i = m_vecWindows.begin(), end = m_vecWindows.end(); i != end; i++) { if((*i) == pWindow) { if(pWindow->getOverlay()) { pRenderer->wait_and_aquire(); m_windowOverlay.cleanup(); pRenderer->image_mut.leaveMutex(); } m_vecWindows.erase(i); pWindow->setActive(false); GUIWindow* pFrontWindow = (!m_vecWindows.empty()?m_vecWindows.front():0); if(pFrontWindow) pFrontWindow->setActive(true); __render(); return; } } }
void pymms::gui::GUIWindowManager::__render() { Render* pRenderer = S_Render::get_instance(); GUIWindow* pWindow = (!m_vecWindows.empty()?m_vecWindows.front():0); if(pWindow && pWindow->getActive()) { if(!pWindow->getOverlay()) { pRenderer->prepare_new_image(); pWindow->render(); pRenderer->draw_and_release("Window"); } else { pRenderer->wait_and_aquire(); if (m_windowOverlay.elements.size() > 0) m_windowOverlay.partial_cleanup(); pWindow->render(&m_windowOverlay); pRenderer->draw_and_release("Window", true); } } }