Original Post
Hey all!
With the following code to process Windows Messages in my WinMain, I''ve noticed processor usage always seems to be 100%:
while(true)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return(msg.wParam);
I thought I remember reading somewhere that there was a way to avoid using a WHILE statement, which in turn only processes Windows Messages when they occur, reducing the processor load on the application.
Am I off base? Was I dreaming? Does it really matter in a hybrid Win-GUI DirectX game?
Thanks for reading,
NoLoGiC