Here is the current code:
case WM_ACTIVATEAPP:
{
if(activated) // activated is set the first time the game window is activated
{
BOOL fActive = (BOOL)wParam;
if(fActive == TRUE)
{
// reacquire dinput devices
keyboard->Acquire();
// restore ddraw surfaces
if(primaryBuffer->IsLost())
{
while(FAILED(primaryBuffer->Restore()))
WaitMessage();
}
if(backBuffer->IsLost())
{
while(FAILED(backBuffer->Restore()))
WaitMessage();
}
// put the game back to the previous state
gameState = prevGameState;
}
else
{
// take down the current state and set the new state
// so that it wont try to update anything
prevGameState = gameState;
gameState = GAME_STATE_NULL;
}
}
} break;
sorry about the bad spacing
------------------------ http://qoy.tripod.com
[This message has been edited by Qoy (edited November 12, 1999).]