Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

WM_PAINT

This topic is 6337 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

I recently down load the source code for a pong game and noticed ALL of the drawing was done outside of the WM_PAINT message. The program had some code in WM_SIZE and other places to make sure that the window was redrawn correctly if it was resized, covered up, etc. My question is then, what if, any are the advantages of doing it this way vs. ddoing all (or most) painting in the WM_PAINT message?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
cos WM_PAINT is slooooooooooooooooooooooooooooooow. You can''t have fast updates using it.

Share this post


Link to post
Share on other sites
The advantage to doing the frame redrawing in WM_PAINT is that once you move the window around, and it gets covered by other stuff etc, it will call the redrawing code.

The advantage, is if you have a app/game which doesnt redraw its frames all the time (it may only be displaying a static image for example), you can save time by only redrawing the window once it is obscured, rather than redrawing it every second if the content doesnt change.

In most games, you will be redrawing the frame each time thru the loop however, so you dont really need to bother about WM_PAINT.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!