In OpenGL 4.5, glVertexArrayElementBuffer was introduced as a part of DSA. VertexArray should add an interface, setIndexBuffer for example, to support this. In this case, one could write:
// :::
vao->setIndexBuffer(ibo);
// :::
without explicitly bind/unbind VAO. This should make the program logically more clear and consistent.
Without DSA, this new interface could be emulated as
Currently, to use index buffer object, one has to manually bind VAO then bind IBO with
GL_ELEMENT_ARRAY_BUFFER
:In OpenGL 4.5,
glVertexArrayElementBuffer
was introduced as a part of DSA.VertexArray
should add an interface,setIndexBuffer
for example, to support this. In this case, one could write:without explicitly bind/unbind VAO. This should make the program logically more clear and consistent.
Without DSA, this new interface could be emulated as