1
\$\begingroup\$

I'm new to game dev and using SFML. I need to use lots of sprites at the same time, so I will probably need sprite batching.

I know that sprite batching is used to draw multiple sprites with a single drawcall, but I have no idea on how it works or how to do it.

How does sprite batching work? (An SFML example would be appreciated.)

\$\endgroup\$
1
\$\begingroup\$

This usually depends. Are the sprites static? If they are, you could use a Vertex Array for storing all of your static geometry and such. I believe there is an example of this in the SFML tutorials, under Vertex Arrays. This is a great way to store maps, but it isn't always suitable for moving sprites, like the player sprite.

http://www.sfml-dev.org/tutorials/2.2/graphics-vertex-array.php

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .