void Helium::RendererInitializationWin::Shutdown() { DynamicDrawer::DestroyStaticInstance(); RenderResourceManager::DestroyStaticInstance(); Renderer* pRenderer = Renderer::GetStaticInstance(); if( pRenderer ) { pRenderer->Shutdown(); Renderer::DestroyStaticInstance(); } WindowManager* pWindowManager = WindowManager::GetStaticInstance(); if( pWindowManager ) { if( m_pMainWindow ) { m_pMainWindow->Destroy(); while( m_pMainWindow ) { pWindowManager->Update(); } } pWindowManager->Shutdown(); WindowManager::DestroyStaticInstance(); } }
/// Run the application loop. /// /// This will not return until the application is ready to shut down and terminate. /// /// @return Result code of application execution. int32_t GameSystem::Run() { WindowManager* pWindowManager = WindowManager::GetStaticInstance(); if( !pWindowManager ) { return 0; } WorldManager& rWorldManager = WorldManager::GetStaticInstance(); while( pWindowManager->Update() ) { rWorldManager.Update(); } return 0; }
/// Shut down this system. /// /// @see Initialize() void GameSystem::Shutdown() { WorldManager::DestroyStaticInstance(); DynamicDrawer::DestroyStaticInstance(); RenderResourceManager::DestroyStaticInstance(); Renderer* pRenderer = Renderer::GetStaticInstance(); if( pRenderer ) { pRenderer->Shutdown(); Renderer::DestroyStaticInstance(); } WindowManager* pWindowManager = WindowManager::GetStaticInstance(); if( pWindowManager ) { if( m_pMainWindow ) { m_pMainWindow->Destroy(); while( m_pMainWindow ) { pWindowManager->Update(); } } pWindowManager->Shutdown(); WindowManager::DestroyStaticInstance(); } HELIUM_ASSERT( !m_pMainWindow ); JobManager::DestroyStaticInstance(); Config::DestroyStaticInstance(); if( m_pObjectLoaderInitialization ) { m_pObjectLoaderInitialization->Shutdown(); m_pObjectLoaderInitialization = NULL; } if( m_pObjectTypeRegistration ) { m_pObjectTypeRegistration->Unregister(); m_pObjectTypeRegistration = NULL; } GameObjectType::Shutdown(); GameObject::Shutdown(); Reflect::Cleanup(); AsyncLoader::GetStaticInstance().Shutdown(); AsyncLoader::DestroyStaticInstance(); Reflect::ObjectRefCountSupport::Shutdown(); GameObjectPath::Shutdown(); CharName::Shutdown(); WideName::Shutdown(); File::Shutdown(); // Perform base System shutdown last. System::Shutdown(); }