KhronosGroup / OpenGL-Refpages

OpenGL and OpenGL ES reference page sources, and generated HTML used as backing store for khronos.org
427 stars 134 forks source link

glVertexAttribPointer() assumes non-default VAO #67

Open tksuoran opened 5 years ago

tksuoran commented 5 years ago

The following text is misleading, because it assumes non-default VAO is bound, and makes it impossible to figure out how to use client side data (compatibility profile).

If pointer is not NULL, a non-zero named buffer object must be bound to the GL_ARRAY_BUFFER target (see glBindBuffer), otherwise an error is generated. pointer is treated as a byte offset into the buffer object's data store. The buffer object binding (GL_ARRAY_BUFFER_BINDING) is saved as generic vertex attribute array state (GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) for index index.

I understand that this is only for legacy use, but IMHO also the compatibility profile should be covered by the reference pages.

Even the specification itself is a bit confusing, because it gives impression that using null pointer is somehow allowed. I suppose null pointer is allowed only so that it is possible to restore default GL state (and to make the default GL state "valid", even though you cannot use the null pointer).

oddhack commented 4 years ago

We don't have the cycles free to support all the compatibility-mode stuff in the current refpages - it would be a huge amount of work. The index to the gl4 refpages does point people to the old 2.1 refpages for compatibility stuff, although that's easy to overlook. If you wanted to propose a PR to this specific page adding a note about compatibility-mode interactions, that would be great. Otherwise, it is doubtful anything will be done about this.