RE: [GD-Windows] message pump problem
Brought to you by:
vexxed72
From: Donavon K. <kei...@ea...> - 2003-11-30 19:07:28
|
Oh, and WRT to this: > But it's essentially the same thing. I'm not executing any of the game > stuff > while there's still messages in the queue (if I did I wouln't get the > stall). > Note the if-else: > > while(1) > { > if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) > { > GetMessage(&msg, NULL, 0, 0); > TranslateMessage(&msg); > DispatchMessage(&msg); > } > else > { > //do game frame here > } > } What Jon was saying is that you're processing at most one message per frame. Not a good idea. Nothing guarantees that your app will receive fewer messages per second than your frame rate and if you're counting on this, you're asking for trouble. You want to pump the queue dry, then do your frame. Donavon Keithley |