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

Author Topic: VertexArray color attribute  (Read 2849 times)

0 Members and 1 Guest are viewing this topic.

Sir Lulzalot

  • Newbie
  • *
  • Posts: 4
    • View Profile
VertexArray color attribute
« on: December 20, 2013, 06:44:15 pm »
I'm currently using a VertexArray to allow the user to draw objects based on where they brush the cursor. Unfortunately for testing purposes I need to either toss a texture or shader to the RenderWindow::draw function if I want to differentiate which stroke is which since I want stroke count to both matter and which stroke does what matter as well.

If I want to change the color of a stroke currently, it'd either be the above method or iterating through the entire VertexArray changing the color of every vertex.

Maybe I'm wrong and I'm missing the simple version somewhere, but this would be a lovely addition.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VertexArray color attribute
« Reply #1 on: December 20, 2013, 07:16:05 pm »
There's no simpler solution, you have to iterate over all the vertices. Or color them in a shader.
Laurent Gomila - SFML developer

Sir Lulzalot

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: VertexArray color attribute
« Reply #2 on: December 20, 2013, 07:19:57 pm »
There's no simpler solution, you have to iterate over all the vertices. Or color them in a shader.

I figured, thanks for the response! It's not a major thing, it's just pretesting before my graphic artist gets to work.