SFML community forums

Help => Graphics => Topic started by: -Nautilus- on August 23, 2016, 03:17:04 am

Title: Faster drawing for multiple shapes
Post by: -Nautilus- on August 23, 2016, 03:17:04 am
I have to draw alot of times the same set of shapes, and i would like to know if there is a way to group those together so that i would only need to perform grouping once and that i could draw that on a RenderWindow faster.
Title: Re: Faster drawing for multiple shapes
Post by: DarkRoku12 on August 23, 2016, 06:17:56 am
You can use the sf::VertexArray  (http://www.sfml-dev.org/tutorials/2.4/graphics-vertex-array.php)class.

Hope you achieve what you are trying to do.
Title: Re: Faster drawing for multiple shapes
Post by: -Nautilus- on August 25, 2016, 02:50:19 am
Ok thanks.
Still 1 question: imagine i have to draw the same shape/whatever alot (rly alot) of times.
what option would be faster: Shape or VertexArray?
Title: AW: Faster drawing for multiple shapes
Post by: eXpl0it3r on August 25, 2016, 09:27:21 am
With draw a lot I assume you mean at different locations, right? Just add all the shapes to the vertex array.