SFML community forums

General => Feature requests => Topic started by: Sir Lulzalot on December 20, 2013, 06:44:15 pm

Title: VertexArray color attribute
Post by: Sir Lulzalot 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.
Title: Re: VertexArray color attribute
Post by: Laurent 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.
Title: Re: VertexArray color attribute
Post by: Sir Lulzalot 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.