Jump to content
  • Advertisement
Sign in to follow this  
Talib

Update Region GDI

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

Hi I have a lot of objects that I draw onto my window, but when I move one object it moves very slowly, however when having less objects it moves faster. I presume this comes in with drawing and redrawing all the objects in WM_PAINT. I use InvalidateRect to update objects when they need redrawing. My question is, in WM_PAINT do I need to check if my objects are in the Update Region to be redrawn or does windows do that for you (which I am doubting now)?

Share this post


Link to post
Share on other sites
Advertisement
Windows will automatically clip to the update region, but it will still process your attempts to write outside the update region. To limit what you attempt to draw to only those items in the update region, you can use RectVisible. Here is an example of redrawing just the update region.

Share this post


Link to post
Share on other sites
Your welcome.

P.S. In re-reading my post, do you think I used the phrase "update region" enough? Maybe I should edit it and add a few more. :)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!