Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Faster drawing for multiple shapes  (Read 4299 times)

0 Members and 1 Guest are viewing this topic.

-Nautilus-

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Faster drawing for multiple shapes
« 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.

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: Faster drawing for multiple shapes
« Reply #1 on: August 23, 2016, 06:17:56 am »
You can use the sf::VertexArray class.

Hope you achieve what you are trying to do.
I would like a spanish/latin community...
Problems building for Android? Look here

-Nautilus-

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Faster drawing for multiple shapes
« Reply #2 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
AW: Faster drawing for multiple shapes
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/