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

Author Topic: Wrong numer of verteces in vertex array  (Read 2065 times)

0 Members and 1 Guest are viewing this topic.

Guardian

  • Newbie
  • *
  • Posts: 4
    • View Profile
Wrong numer of verteces in vertex array
« on: November 15, 2017, 09:22:32 pm »
I'm reading the tutorial on sf::VertexArray ( https://www.sfml-dev.org/tutorials/2.4/graphics-vertex-array.php ) and I don't understand what happens if I try to draw a vertex array with a wrong number of vertices for his primitive type. 
For example: what could happen if I drew a vertex array of 5 vertices using the sf::Lines primitive?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10835
    • View Profile
    • development blog
    • Email
Re: Wrong numer of verteces in vertex array
« Reply #1 on: November 15, 2017, 10:01:15 pm »
In my opinion you're asking the wrong question. You don't need to know what happens, but you need to find a way to prevent that it does happen. ;)

Might be implementation dependent and the GPU driver decides what really happens.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Guardian

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Wrong numer of verteces in vertex array
« Reply #2 on: November 15, 2017, 10:09:38 pm »
so it's an undefined behavior and I have to avoid it in every case.

Thank you.