Okay, next question up. My current game is doing the traditional "run
as fast as you can" model of execution, which eats CPU like mad stupid
crazy. The traditional loop is:
while ( PeekMessage( ... ) )
{
if ( GetMessage( ... ) )
{
Translate/DispatchMessage( ... );
}
else
{
//app quit
}
}
To avoid hammering the CPU, I'm thinking of slightly changing it to:
if ( bPaused )
{
WaitMessage();
}
//do regular loop here
Are there any hidden gotchas with WaitMessage()?
One other thing I've noticed is that I'm constantly getting WM_MOUSEMOVE
messages even if the mouse isn't moving (confirmed with Spy++). I
assume this is expected behaviour?
Brian
|