Jump to content
  • Advertisement
Sign in to follow this  
Carolina

[SDL] Partial refreshing

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

Hello there! I´d like to know if you guys have any ideas on how to do something like a 'partial refreshing' of a game screen. For instance, if I have a sprite walking around, and I want the last frame that was blitted onto the screen to be erased without refreshing the whole background, what should I do? My idea is to somehow, before blitting the frame to be displayed next, 'cut' the background part it will occupy, and then, after the sprite has moved to somewhere else(but before reblitting it), put this background piece back into place. Is there a reasonable way to do this? Or, in a 2D RPG-like game like mine, with lots of objects to be changed, the fastest way is to really blit everything again, for every game state change? Thanks in advance, Carol

Share this post


Link to post
Share on other sites
Advertisement
It's totally possible and the idea that you described sounds like a good way to do it. Maybe this technique was useful on 10MHz processors, but with modern computers you are probably better off redrawing the whole screen every frame. That way you could have your game running in a window and it won't show garbage whenever another window blocks it.

However, if your game runs slow because it's limited by the fill rate, you might consider doing a partial screen redraw.

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!