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

Author Topic: Trying to understand how Vertex Array works and what it does  (Read 1034 times)

0 Members and 2 Guests are viewing this topic.

BobbyT432

  • Newbie
  • *
  • Posts: 8
    • View Profile
Trying to understand how Vertex Array works and what it does
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Trying to understand how Vertex Array works and what it does
« Reply #1 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?
Laurent Gomila - SFML developer

BobbyT432

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Trying to understand how Vertex Array works and what it does
« Reply #2 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.