Update the screen when moving

Started by
1 comment, last by 23yrold3yrold 17 years, 10 months ago
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
Advertisement
You can reblit and update the changed area only.
SDL_BlitSurface and SDL_UpdateRects both have a rect parameter for it.
Le repost.

Jesus saves ... the rest of you take 2d4 fire damage.

This topic is closed to new replies.

Advertisement