Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


VAO and GL_ELEMENT_ARRAY_BUFFER.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 bluntman   Members   -  Reputation: 249

Like
1Likes
Like

Posted 17 April 2014 - 08:11 PM

The OpenGL wiki has me confused here:

 

 

 

Index buffers

Indexed rendering, as defined above, requires an array of indices; all vertex attributes will use the same index from this index array. The index array is provided by a Buffer Object bound to the GL_ELEMENT_ARRAY_BUFFER​binding point. When a buffer is bound to GL_ELEMENT_ARRAY_BUFFER​, all rendering commands of the formgl*Draw*Elements*​ will use indexes from that buffer. Indices can be unsigned bytes, unsigned shorts, or unsigned ints.


The index buffer binding is stored within the VAO. If no VAO is bound, then you cannot bind a buffer object to GL_ELEMENT_ARRAY_BUFFER​.

 

You CAN'T bind to GL_ELEMENT_ARRAY_BUFFER unless you have already bound a VAO?! This makes no sense to me as one would naturally want to bind to GL_ELEMENT_ARRAY_BUFFER when filling it in and not want to be worried about binding an associated VAO. Is there another way to fill an index buffer? Does having 0 bound as VAO count as having a VAO bound? 

 



Sponsor:

#2 Chris_F   Members   -  Reputation: 2465

Like
1Likes
Like

Posted 17 April 2014 - 09:03 PM

The GL_ELEMENT_ARRAY_BUFFER state belongs to the currently bound VAO, if no VAO is bound, then you cannot set this state. Core profile requires you to generate and bind a valid VAO, binding "0" is not an option.



#3 cgrant   Members   -  Reputation: 761

Like
0Likes
Like

Posted 18 April 2014 - 12:48 PM

VAO and GL_ELEMENT_ARRAY_BUFFER are mutually exclusive, in the sense that you don't need the other for one to work.



#4 Chris_F   Members   -  Reputation: 2465

Like
0Likes
Like

Posted 18 April 2014 - 01:45 PM

VAO and GL_ELEMENT_ARRAY_BUFFER are mutually exclusive, in the sense that you don't need the other for one to work.

 

You may not need an element array buffer to use a VAO, but you most certainly do require a VAO to use an element array buffer. The excerpt from the wiki makes that perfectly clear.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS