I use Ogre, IOS, CEGUI to develop my Game. this is main.cpp
CMKGame* game = CMKGame::create();
if(game->init())
game->run();
CMKGame::destroy();
After init Ogre, I create a render window:
Ogre::RenderWindow* pRenderWindow = Ogre::Root::getSingleton().createRenderWindow(
"MK", 1024, 768, false, &windowParametterList);
If I click on default Close button on the Main render window, the window will be close and the CMKGame::destroy function will be called to unload resources and destroy other things. So Game exit properly.
But, In login Game state, I have a button to exit the game, and when click on this button, I wanna exit game. So I call the function CMKGame::destroy in OnExitButtonClicked(), but the Render window is not closed so the game is crashed because of something relate to OIS mouse capture, click.
How can I close the Render Window before calling CMKGame::destroy or any one has other solutions to resolve this problem.
[Resolved]How to quit a game properly using a button
Moderators: CEGUI MVP, CEGUI Team
[Resolved]How to quit a game properly using a button
Last edited by metylbk on Fri Dec 02, 2011 05:02, edited 1 time in total.
Re: How to quit a game properly using a button in CEGUI
Not a CEGUI question at all. You probably should flip some switch that will cause the runloop to terminate.
EDIT: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=67793
EDIT: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=67793
Who is online
Users browsing this forum: No registered users and 13 guests