Draw the same sprite multiple times (SDL)?

Hello!
I have a question about SDL and drawing sprites (SDL surfaces). My idea is that the user can create a wall of separate sprites by create one sprite each time in the current mouseX and mouseY position, when the user push down the e-key. The problem is that I have no idea how I could draw the same sprite multiple times without to delete the previous one. I'm fairly new in SDL, so easy examples would be very appreciated.
sorry for bad english, and thanks for answers.
Last edited on
Drawing is simply the process of copying the pixels from one memory region (the target of surface->pixels) to another. To draw the same SDL_Surface several times you just call SDL_BlitSurface() with the same src and dst parameters several times.
@helios

but I could not get that to work... I want something like this:

https://www.youtube.com/watch?v=5fmsEOaan64&index=3&list=PLdEIAFiH2OKC_t93KZSA_64QOEizMx4tw

I want to duplicate the same sprite, but in an another position. I have tried to blit it with the same src and dst... but it only replace the previous one.

Last edited on
You have to change the dst_rect parameter, obviously.
Topic archived. No new replies allowed.