Jump to content
  • Advertisement
Sign in to follow this  
negflar

Update the screen when moving

This topic is 4526 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 question about updating the screen during an animation. I have a main surface called screen. Another that i use for background and the last, for animated prite. I apply background surface and sprite surface with SDL_BlitSurface to main surface. When i move the sprite around the screen, i redraw (with SDL_Blit surface) in a different position. Obviously, the old position are still visible. The only way that i have found to fix that is to reblitting also the background before i reblit the sprite surface. It is a good solution? My question is if exist another way to refresh the backgorund without having to reblit it. Tank's

Share this post


Link to post
Share on other sites
Advertisement
You can reblit and update the changed area only.
SDL_BlitSurface and SDL_UpdateRects both have a rect parameter for it.

Share this post


Link to post
Share on other sites

This topic is 4526 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.

Guest
This topic is now closed to further replies.
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!