Sickes
28-06-2008 21:14:14
Hi!
I have a system that creates and initialize the mogre engine. After it using I need destroy all and create the mogre engine again (whith the same code).
I have problems trying this last part.
First I don't know exactly what I must destroy to unload completely mogre.
Now i do the next:
mRoot.QueueEndRendering();
mRoot.Shutdown();
//destruimos todo
//destruimos la scena
sManager.DestroyAllCameras();
sManager.DestroyAllEntities();
sManager.DestroyAllMovableObjects();
sManager.ClearScene();
mRoot.DestroySceneManager(sManager);
sManager.Dispose();
sManager = null;
//destruimos los handlers a eventos(NADA)
//Destruimos los listeners
//Destruimos los resource groups
ResourceGroupManager.Singleton.ClearResourceGroup("General");
//destruimos la render window
mRoot.DetachRenderTarget(window);
window.Destroy();
window = null;
When I initialize the mogre again it throws me a exception when create the Scene:
OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for planomesa automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at ...
in the second line of this code:
MeshManager.Singleton.CreatePlane("planomesa", "General", plano, 1024, 768);
Entity ePlanoCara = mgr.CreateEntity("mesa", "planomesa");
It seems that mogre can't find the Group of Mesh "planomesa" and the findGroupContainingResource method throws the exception. But the first time I initialize mogre and I create the scene all works fine.
Does anybody can help me?
Thanks
I have a system that creates and initialize the mogre engine. After it using I need destroy all and create the mogre engine again (whith the same code).
I have problems trying this last part.
First I don't know exactly what I must destroy to unload completely mogre.
Now i do the next:
mRoot.QueueEndRendering();
mRoot.Shutdown();
//destruimos todo
//destruimos la scena
sManager.DestroyAllCameras();
sManager.DestroyAllEntities();
sManager.DestroyAllMovableObjects();
sManager.ClearScene();
mRoot.DestroySceneManager(sManager);
sManager.Dispose();
sManager = null;
//destruimos los handlers a eventos(NADA)
//Destruimos los listeners
//Destruimos los resource groups
ResourceGroupManager.Singleton.ClearResourceGroup("General");
//destruimos la render window
mRoot.DetachRenderTarget(window);
window.Destroy();
window = null;
When I initialize the mogre again it throws me a exception when create the Scene:
OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for planomesa automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at ...
in the second line of this code:
MeshManager.Singleton.CreatePlane("planomesa", "General", plano, 1024, 768);
Entity ePlanoCara = mgr.CreateEntity("mesa", "planomesa");
It seems that mogre can't find the Group of Mesh "planomesa" and the findGroupContainingResource method throws the exception. But the first time I initialize mogre and I create the scene all works fine.
Does anybody can help me?
Thanks