Hello!
Hello! :)
I don't want to store every sf::CircleShape individually since that takes too much memory and makes the program slow.
How much memory do you think they take? Storing lots of circles shouldn't be slowing down your program. However, drawing lots of them may do that.
Is there a way to make a single sf::CircleShape and use (tranform?) something to move and scale the circle with the vectors mentioned above?
Yes, this is possible. You can create a single sf::CircleShape and modify it between each draw; this avoid the storage (but you still need to store where they are going to be somewhere) but makes the code messy (separating updating and drawing is a common 'tidy' approach).
And is there a way to draw them with a single RenderTarget::draw() like with sf::VertexArray?
sf::CircleShapes? No.
Two options that I can think of:
- If the circles don't move (at all or maybe don't move much), draw them all to a single render texture and then you only need a single draw call to draw that render texture,
- Create a vertex array and add the multiple circles to that vertex array; note that you will need to calculate the positions of all the points of each circle (you would probably use sf::Triangles for this)