DemoApp::~DemoApp() { #ifdef INCLUDE_RTSHADER_SYSTEM mShaderGenerator->removeSceneManager(OgreFramework::getSingletonPtr()->m_pSceneMgr); destroyRTShaderSystem(); #endif delete OgreFramework::getSingletonPtr(); }
OgreApp::~OgreApp() { #ifdef INCLUDE_RTSHADER_SYSTEM mShaderGenerator->removeSceneManager(OgreFramework::getSingletonPtr()->m_pSceneMgrMain); destroyRTShaderSystem(); #endif delete engineStateMgr; //delete player; delete OgreFramework::getSingletonPtr(); }
void ApplicationContext::shutdown() { if (Ogre::GpuProgramManager::getSingleton().isCacheDirty()) { Ogre::String path = mFSLayer->getWritablePath(SHADER_CACHE_FILENAME); std::fstream outFile(path.c_str(), std::ios::out | std::ios::binary); if (outFile.is_open()) { Ogre::LogManager::getSingleton().logMessage("Writing shader cache to "+path); Ogre::DataStreamPtr ostream(new Ogre::FileStreamDataStream(path, &outFile, false)); Ogre::GpuProgramManager::getSingleton().saveMicrocodeCache(ostream); } } #ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM // Destroy the RT Shader System. destroyRTShaderSystem(); #endif // remove window event listener before destroying it if(mWindow) { Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this); mRoot->destroyRenderTarget(mWindow); mWindow = NULL; } if (mOverlaySystem) { OGRE_DELETE mOverlaySystem; } #if OGRE_BITES_HAVE_SDL if(mSDLWindow) { SDL_DestroyWindow(mSDLWindow); SDL_QuitSubSystem(SDL_INIT_VIDEO); mSDLWindow = NULL; } #endif #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID AConfiguration_delete(mAConfig); #endif }