It could be simply [...]
Yes, but you mentioned an alternate approach, so I thought you would have an idea besides extending the
sf::Sprite interface.
Because this one sounds very cumbersome to use: The user has to keep both
sf::Sprite and
sf::VertexArray, and he needs to synchronize them manually. The whole rendering and transform information is effectively duplicated.
I can see the benefit of sf::Sprite for prototyping, however achieving maximum performance would always be on my todo list.
Maximum performance is an unclear objective, you can never reach that. It is important to profile the application, find the bottlenecks and optimize them specifically. In more complex games, other tasks such as pathfinding or physics may be the real performance killer, in such cases it's pointless to optimize the last cycle out of rendering.
I am not against features that allow the usage of "efficient" sprites (through vertex arrays), but it shouldn't be even more complicated than what's currently possible. The reason why vertex arrays are so tedious to use is that you have to handcraft everything on your own. With higher-level helper functions (create vertices from a texture rect and transform, set the color for multiple vertices, etc.) this task would be much simpler. And exactly these functions are already implemented in
sf::Sprite, therefore a solution should aim at reusing them where possible.
The question is whether such a sprite batch would still require sprites?
sf::Sprite would then just be an intermediate class -- between the game logic that sets the attributes and the vertex array which is drawn. If there were an interface similar to what
sf::Sprite provides, but internally directly operating on a
sf::VertexArray, that would be nice.