SFML community forums

Help => Graphics => Topic started by: ILostMyAccount on February 17, 2015, 11:11:58 am

Title: Sprite batching?
Post by: ILostMyAccount on February 17, 2015, 11:11:58 am
Can someone explain me what exactly is the sprite batching?
And can you link me an example of code in SFML?

Thank you.
Title: Re: Sprite batching?
Post by: eXpl0it3r on February 17, 2015, 11:32:43 am
How about you use the search function to find it yourself?
Because that's exactly what I now have to do, just so you don't have to do it....
Title: Re: Sprite batching?
Post by: InverseSec on February 20, 2015, 10:00:42 pm
I'd like an answer for this too. I assumed that having a single spritesheet with all the sprites for different objects would be fine, and I could just draw each thing individually, and since it uses the same spritesheet (albeit with different coordinates for the intrect), it would be fine.
Apparently that's not the case.

Also, I used the search function and could not find another topic for this.
Title: Re: Sprite batching?
Post by: dabbertorres on February 20, 2015, 10:47:29 pm
In short: Sprite Batching is a way to draw lots of things all in one draw call. All those things must come from the same texture.

Here's how I came up with my own way to do sprite batching:
https://github.com/dabbertorres/SwiftSpriteBatch

It uses a sf::VertexArray to draw everything.