1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +00:00

during cleanup we now delete all plugins created

This commit is contained in:
Brother Brick 2012-09-17 11:57:29 +02:00
parent 44c644dd7b
commit ff54508633
2 changed files with 31 additions and 2 deletions

View file

@ -44,8 +44,10 @@ void OgreRenderer::cleanup()
delete mFader;
mFader = NULL;
OGRE_DELETE mRoot;
delete mRoot;
mRoot = NULL;
unloadPlugins();
}
void OgreRenderer::start()
@ -103,6 +105,31 @@ bool OgreRenderer::loadPlugins()
return true;
}
bool OgreRenderer::unloadPlugins()
{
#ifdef ENABLE_PLUGIN_GL
delete mGLPlugin;
mGLPlugin = NULL;
#endif
#ifdef ENABLE_PLUGIN_Direct3D9
delete mD3D9Plugin;
mD3D9Plugin = NULL;
#endif
#ifdef ENABLE_PLUGIN_CgProgramManager
delete mCgPlugin;
mCgPlugin = NULL;
#endif
#ifdef ENABLE_PLUGIN_OctreeSceneManager
delete mOctreePlugin;
mOctreePlugin = NULL;
#endif
#ifdef ENABLE_PLUGIN_ParticleFX
delete mParticleFXPlugin;
mParticleFXPlugin = NULL;
#endif
return true;
}
void OgreRenderer::update(float dt)
{
mFader->update(dt);

View file

@ -151,7 +151,9 @@ namespace OEngine
/// Start the main rendering loop
void start();
bool loadPlugins() ;
bool loadPlugins();
bool unloadPlugins();
void update(float dt);