Jump to content
  • Advertisement
Sign in to follow this  
kubicon

Question of when to blit

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

When is it the proper time to blit into the primary buffer (or to second then flip). I just noticed that if I blit an image it stays in the screen. Is it wise to only blit an image, such as a background, when change is detected? or should I blit all the images on each iteration of the main loop?

Share this post


Link to post
Share on other sites
Advertisement
It depends..
One problem is that Windows could've invalidated the window contents, which you'd have to handle in order to skip "unnecessary" blits.
Many older games use a technique called dirty rectangles that only tries to copy those back buffer parts that has actually been updated. This doesn't work very well anymore since most of the screen is updated every frame (i.e. when scrolling) and static scenes rarely consume much CPU power anyway.
If you're optimizing a general purpose UI system it might be worth the effort however few games would gain much from this 'trick'.

Share this post


Link to post
Share on other sites
I understand.

But it's easy for me to check if the background has been invalidated. Although I would have to check the other sprites to see if they have been changed because otherwise they would invalidate the background image.

Never mind.

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!