Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well, I'm sort of a beginner to SDL, and I was wondering how one would go about deleting an image from the screen and replacing it with another? I attempted to do this, but it didn't seem to change it, how would someone with more experience than me go about doing it?

share|improve this question
I'm unfamiliar with SDL, but in most graphics I've worked with, you must always specifically draw the image every frame for it to remain there. To make it disappear, I'd just stop calling the code that draws it. – Anko Jan 14 '13 at 3:05
Some more detail on what you're doing currently and why you think that's not working for you would be useful to potential answerers. – Anko Jan 14 '13 at 3:07

You need to flip the buffer surface to the screen to make it update. You need SDL_Flip function.

Take a look at this tutorial: Lazy Foo' SDL Tutorial

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.