Jump to content
  • Advertisement
Sign in to follow this  
bluntman

OpenGL VAO and GL_ELEMENT_ARRAY_BUFFER.

This topic is 2007 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? 

 

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!