76
General discussions / Re: SFML 3 - What is your vision?
« on: April 28, 2014, 05:06:20 pm »A sprite batch is just a way to reduce the number of draw call for things that use the same texture.
This code for example:Code: [Select]SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);
If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.
For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it.
Perhaps I oversimplified it by mentioning only one texture, but yeah, sprite batches should work regardless of the thing being drawn has the same texture as anything else in the batch. That was just supposed to be a basic example to explain the underlying concept to eXpl0it3r.