Jump to content
  • Advertisement
Sign in to follow this  
Mafioso

Program that handles only WindowProcedure messages

This topic is 3040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The problem is that the game loop uses 50% of CPU and I only want to handle window procedure messages, is there are way to make program that only handles them? Without using 50% of CPU?

Share this post


Link to post
Share on other sites
Advertisement
Set up your message loop like a typical Win32 app (see Petzold). Then do your drawing in WM_PAINT.

Share this post


Link to post
Share on other sites
Quote:
Original post by Quat
Set up your message loop like a typical Win32 app (see Petzold). Then do your drawing in WM_PAINT.
To expand on that a little; use GetMessage() instead of PeekMessage(). Then your app will block in GetMessage() and use no CPU time, until a message comes along.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by Quat
Set up your message loop like a typical Win32 app (see Petzold). Then do your drawing in WM_PAINT.
To expand on that a little; use GetMessage() instead of PeekMessage(). Then your app will block in GetMessage() and use no CPU time, until a message comes along.


Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!