|More CPU-friendly message loop
Post Date :
Hi, I've read that a message loop for a game should use a 'real-time' message loop such as:
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
if(msg.message == WM_QUIT)
However when I implemented it into my programs I find that it hogs up a lot of the CPU Usage and causes excessive system lag. So, I was wondering what would be a proper method to prevent or fix this problem while still having a real-time message loop. Any help is appreciated.
All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005