1
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Anko Jan 14 '13 at 3:05
  • \$\begingroup\$ 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. \$\endgroup\$ – Anko Jan 14 '13 at 3:07
1
\$\begingroup\$

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

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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