Hi guys,
I am currently looking to write a Sprite Batch class to assist in rendering a large number of sprites and would like some advice so that I don't needlessly double up on transform calculations.
My approach is to write a custom Sprite class that inherits only from Transformable (not Drawable) and provides a function to get it's (untransformed) vertices. I would also write a Sprite Batch class with an "addToBatch" function that takes a custom Sprite object. The Sprite Batch would get the Sprites vertices and its Transform, apply the transform and store the resulting vertices in a Vertex Array (or Vertex Buffer).
The Sprite Batch itself would inherit from Transformable and Drawable so that it can be rendered as though it were a native SFML entity. Within the inherited draw function, it would send set the Render State's Texture and draw a bunch of Sprites in a single draw call. This seems straight forward, but I noticed in the source code for Render Target, that the Render State's Transform is applied to all of the vertices before drawing. This would mean that all vertices have had two transformations applied in total. Is this something that would be detrimental to performance? Or am I being overly paranoid?