I'm having a small problem getting my game loop to work properly using MFC.
I use to following code:
I use to use the following code:
I am trying to do the equivalent of the following code using MFC.
while( true )
{
if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
if (msg.message == WM_QUIT) break;
}
else
{
UpdateGame();
}
}
Currently I'm doing this: (CClientSystemApp is a derivation of CWinApp)
BOOL CClientSystemApp::PumpMessage()
{
UpdateGame();
return CWinApp::PumpMessage();
}
But I don't think this is the right place for it. It seems to be waiting for messages before updating the game.
Does anyone know where I should put this function call using MFC?
Thanks for your help!
[edited by - enfekted on January 25, 2004 4:02:10 PM]
[edited by - enfekted on January 25, 2004 4:03:26 PM]
[edited by - enfekted on January 25, 2004 5:04:22 PM]
[edited by - enfekted on January 25, 2004 5:08:37 PM]
[edited by - enfekted on January 25, 2004 5:29:27 PM]