SFML community forums

Help => Graphics => Topic started by: BobbyT432 on April 27, 2020, 03:31:16 am

Title: Trying to understand how Vertex Array works and what it does
Post by: BobbyT432 on April 27, 2020, 03:31:16 am
I've currently made a tilemap that is fed into a vertex array, I used the example from the Vertex Array sfml tutorial. From my understanding, a vertex array is filled with textures which then turn the entire vertex array into one WHOLE texture? so instead of writing to the screen and rendering the entire map with a for loop, it does it once and stores it into an array which can then just be printed to the screen?

I'm trying to understand what a vertex array is actually doing and why it is so nice for tile maps.
Thank you.
Title: Re: Trying to understand how Vertex Array works and what it does
Post by: Laurent on April 27, 2020, 08:30:23 am
No, what you describe is sf::RenderTexture. sf::VertexArray stores points, interpreted as primitives (points, lines or triangles) at draw time. It's geometry. Textures can be mapped onto vertex arrays, to produce sprites or whatever.

Have you really read all the documentation and tutorials available?
Title: Re: Trying to understand how Vertex Array works and what it does
Post by: BobbyT432 on April 29, 2020, 12:33:28 am
I've gone through many of the tutorials however I have been confused on how vertex arrays work for a while now, you've cleared that confusion up for me so thank you.