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

Author Topic: Order of drawing vertices in vertexarray  (Read 2377 times)

0 Members and 1 Guest are viewing this topic.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Order of drawing vertices in vertexarray
« on: December 06, 2012, 04:41:04 am »
Can there be any assumption about order of drawing primitives in vertexarray? For example 8 vertices, two quads, first one is big rectangle, other is smaller one with it's area completely contained in the area of first one. Will both always show, first in array getting drawn first or is it (implementation /un)defined?
Back to C++ gamedev with SFML in May 2023

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: Order of drawing vertices in vertexarray
« Reply #1 on: December 06, 2012, 05:51:39 am »
OpenGL draws them in order and I didn't see any reordering in the source for sf::RenderTarget.  Seems like a safe assumption.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Order of drawing vertices in vertexarray
« Reply #2 on: December 06, 2012, 07:50:41 am »
Yes it should be safe, however I don't know if it's explicitely written in the OpenGL spec.
Laurent Gomila - SFML developer

cire

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Re: Order of drawing vertices in vertexarray
« Reply #3 on: December 06, 2012, 08:15:46 am »
Quote
When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first.

Found here.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Order of drawing vertices in vertexarray
« Reply #4 on: December 06, 2012, 08:32:06 am »
Thanks :)
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Order of drawing vertices in vertexarray
« Reply #5 on: December 06, 2012, 11:42:09 pm »
Thanks too.
Err... by construct it means render, right?  ;D
« Last Edit: December 06, 2012, 11:44:48 pm by FRex »
Back to C++ gamedev with SFML in May 2023

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Order of drawing vertices in vertexarray
« Reply #6 on: December 07, 2012, 12:00:12 am »
Quote
Err... by construct it means render, right?
Of course :P
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Order of drawing vertices in vertexarray
« Reply #7 on: December 07, 2012, 12:05:21 am »
Ah.. obviously it does.. ::)
Thanks. ;)
Back to C++ gamedev with SFML in May 2023

 

anything