Toby
19-12-2006 09:34:23
Hello, I'm trying to create a game state machine using for menu intro BetaGUI(great but you ll laugh of me) and using a nxOgre_World for playsate.
I can launch application and go on menu, launch playstate and come back to menu, but when I re-launch playstate I obtain this error:
When I quit my playstate I do this:
For each state I create a new SceneManager and for playstate I create a new world.
What is wrong? thx
I can launch application and go on menu, launch playstate and come back to menu, but when I re-launch playstate I obtain this error:
10:08:30: An exception has been thrown!
-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name NxOgre.ErrorCube already exists..
File: \OgreDev\Dagon\OgreMain\src\OgreResourceManager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
When I quit my playstate I do this:
void PlayState::exit()
{
delete mWorld;
if(mVehicle)
delete mVehicle;
mSceneMgr->clearScene();
mSceneMgr->destroyAllCameras();
mRoot->getAutoCreatedWindow()->removeAllViewports();
mSceneMgr->destroyAllBillboardSets();
mSceneMgr->destroyAllParticleSystems();
mSceneMgr->destroyAllMovableObjects();
mSceneMgr->destroyAllEntities();
mSceneMgr->destroyAllLights();
mSceneMgr->destroyAllManualObjects();
mSceneMgr->destroyAllStaticGeometry();
mSceneMgr->destroyAllAnimations();
mSceneMgr->destroyAllAnimationStates();
std::cout << "PlayState exit\n";
}
For each state I create a new SceneManager and for playstate I create a new world.
What is wrong? thx