destroyRenderTarget and several windows

Problems building or running the engine, queries about how to use features etc.
Post Reply
ntrofimov
Gnoblar
Posts: 1
Joined: Fri Aug 17, 2018 3:10 am

destroyRenderTarget and several windows

Post by ntrofimov »

Ogre Version: 1.10.9
Operating System: Windows 10
Render System: DirectX11

Hi all,

Should I call

Code: Select all

Ogre::Root::destroyRenderTarget()
member function manually to destroy windows created by

Code: Select all

Ogre::Root::createRenderWindow()
?

I'm asking you this question because I have a problem destroying render windows in the following case:
  • Create first window via Ogre::Root::createRenderWindow(). This window is assigned as a main window internally by OGRE itself.
  • Create second window via Ogre::Root::createRenderWindow().
  • Destroy first window via Ogre::Root::destroyRenderTarget(). As it was the main window the mMainWindow pointer is NULL now.
  • Create new window via Ogre::Root::createRenderWindow(). OGRE thinks that this is a new main window but crashes on D3D11TextureManager constructor as it is a singleton that was already created before (on the first call to Ogre::Root::createRenderWindow).
It is actually an assert defined in OgreSingleton.h:

Code: Select all

Singleton( void )
{
    assert( !msSingleton );
    // ...
}
What should I do to get rid of this error?

Thanks.
Post Reply