How do you start your game loop? Is it something like this:
- Code:
// WinMain - Application Entry Point
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPTSTR, int )
{
_Module.Init( 0, hInstance );
pMyGame = new MyGame();
pMyGame->Run();
return 0;
}
If so, you could wrap the two "pMyGame..." lines in a loop, checking for an orientation change with a global variable... Like this:
- Code:
bool bOrientationChange;
// WinMain - Application Entry Point
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPTSTR, int )
{
_Module.Init( 0, hInstance );
bOrientationChange = true;
while(bOrientationChange)
{
bOrientationChange = false;
pMyGame = new MyGame();
pMyGame->Run();
}
return 0;
}
That way, if you change bOrientationChange to true somewhere in your game, and then call Shutdown(), it should restart. Of course, you'll need to set an orientation variable somewhere too so it knows which orientation to use. You can also use a variable for whether or not to play the game's splash screen, to keep the user from having to wait any longer than necessary.
-John