SFML community forums

Help => Graphics => Topic started by: Kaphonaits on July 23, 2013, 12:06:34 am

Title: Copying sf::Sprite(s) -> sf::Image
Post by: Kaphonaits on July 23, 2013, 12:06:34 am
I have a 2d array of sf::Sprites.  Is there a way for me to copy all of them to one sf::Image / similar type and then draw the single image/type they were copied to?

Thanks a bunch.
Title: Re: Copying sf::Sprite(s) -> sf::Image
Post by: eXpl0it3r on July 23, 2013, 02:36:38 am
I hope you're using SFML 2, otherwise you should switch asap! ;)

With SFML 2, you can draw your sprites onto a sf::RenderTexture and then use that texture to draw. Keep in mind though, that it's no problem for your GPU to draw a few sprites and if you draw the sprites to the render texture every game loop iteration, then you're wasting quite a bit of processing time, since you could've drawn them directly to the screen. ;)