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

Author Topic: Question about sf::VertexArray  (Read 1489 times)

0 Members and 1 Guest are viewing this topic.

massive_potato

  • Newbie
  • *
  • Posts: 37
    • View Profile
Question about sf::VertexArray
« on: August 12, 2012, 09:36:19 pm »
I have created a polygon class and am trying to render it. I created a vertex array containing each point of the polygon and am able to draw the shape to a window, but have no way of changing the color of the polygon's outline (it draws white lines). Is there some way of doing this without resorting to sf::Shape (the polygons can be both concave and convex, preventing me from using the sf::Shape class)?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Question about sf::VertexArray
« Reply #1 on: August 12, 2012, 10:06:16 pm »
Each vertex is defined through a position, a color and a texture coordinate, so if you want you outline to be red, you'll just have to change the color of the vertex. Then again I don't know how you construct your polygon.
Note if you just want to have a ConcaveShape I can point you to Thor, which has such a class implemented.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

massive_potato

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Question about sf::VertexArray
« Reply #2 on: August 14, 2012, 09:25:05 pm »
Thanks for the response!

 

anything