Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - GL_OES_vertex_buffer_object extension incorrect defines.: (7 Items)
   
GL_OES_vertex_buffer_object extension incorrect defines.  
GLES/glext.h contains definition of functions:

glBindBufferOES(), glDeleteBuffersOES(), glGenBuffersOES(), glIsBufferOES(), glBufferDataOES(), glBufferSubDataOES(), 
glGetBufferParameterivOES().

And defines for GL_OES_vertex_buffer_object extension:

#define GL_ARRAY_BUFFER                                         0x8892
#define GL_ELEMENT_ARRAY_BUFFER                                 0x8893
.... etc.

This is incorrect, since all defines must have _OES suffix, since it is an extension, not a part of OpenGL ES 1.0. 
Defines must be like this:

#define GL_ARRAY_BUFFER_OES                                        0x8892
#define GL_ELEMENT_ARRAY_BUFFER_OES                          0x8893
.... etc.
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
Correct.

GLES/glext.h should define GL_ARRAY_BUFFER_OES. GLES/gl.h should define GL_ARRAY_BUFFER if GL_VERSION_ES_CM_1_1 or 
GL_VERSION_ES_CL_1_1 is defined. The same is true for all the other GL_OES_vertex_buffer_object constants.
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
> Correct.
> 
> GLES/glext.h should define GL_ARRAY_BUFFER_OES. GLES/gl.h should define 
> GL_ARRAY_BUFFER if GL_VERSION_ES_CM_1_1 or GL_VERSION_ES_CL_1_1 is defined. 
> The same is true for all the other GL_OES_vertex_buffer_object constants.

By the way, libGLES_CM in 6.4.0 and in 6.4.1 contains glBindBuffer() instead of glBindBufferOES(). The same for the 
other VBO functions.

Since I'm using dynamic address loading for VBO functions, I've not noticed that they are having wrong names. But 
eglGetProcAddress() handles xxxxxdOES names and returns correct address for all VBO functions with or without OES suffix
.
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
Extension functions are not required to be named the same as the string that is used to get them unless they are also 
exported statically.
That's why eglGetProcAddress("glBindBufferOES") can return the address of a function named glBindBuffer. You wouldn't 
want to force eglGetProcAddress("glBindBufferOES") to return a pointer to a glBindBufferOES function on a OpenGL ES 1.1 
implementation...

From the EGL 1.4 spec on eglGetProcAddress:

[...]
For functions that are queryable with eglGetProcAddress, implementations may choose to also export those functions 
statically from the object libraries implementing those functions. However, portable clients cannot rely on this 
behavior.
[...]
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
> Extension functions are not required to be named the same as the string that 
> is used to get them unless they are also exported statically.
> That's why eglGetProcAddress("glBindBufferOES") can return the address of a 
> function named glBindBuffer. You wouldn't want to force eglGetProcAddress("
> glBindBufferOES") to return a pointer to a glBindBufferOES function on a 
> OpenGL ES 1.1 implementation...

No, I mean glBindBuffer() function is exported inside shared object, so if application uses it's own declarations (GLES 
headers), it can be linked even if it uses glBindBuffer() function directly. Maybe better to rename all VBO functions 
with underscore prefix, like _glBindBuffer() or to use GCC's special directive for function exporting and to hide the 
rest functions, which are not belong to an API.
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
They are part of OpenGL ES 1.1, so unless your application code targets platforms with OpenGL ES frozen at 1.0, you 
shouldn't have functions named glBindBuffer, glPointParameterf etc in your code.
Re: GL_OES_vertex_buffer_object extension incorrect defines.  
By the way, GL_VERSION_ES_CM_1_0 and GL_VERSION_ES_CL_1_0 are not defined in QNX 6.4.1, only GL_OES_VERSION_1_0 is 
defined.