Page 1 of 1

GL extensions

Posted: Sun Jun 24, 2012 8:02 am
by RichardUK
Are the extensions listed in gl2ext.h all supported? I was always under the impression that for GLES the devices headers were specific to the chip. That is the hardware manufacture take the headers from Khronos and changed them for their hardware.

Re: GL extensions

Posted: Sun Jun 24, 2012 8:52 am
by jmacey
I think it's a standard header with switches turned on for what is implemented. When I was looking for Vertex Array Objects I found this in the header

Code: Select all

/* GL_OES_vertex_array_object */
#ifndef GL_OES_vertex_array_object
#define GL_OES_vertex_array_object 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
#endif
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
#endif
However GL_OES_vertex_array_object was undefined in the main platform header and if you try to define it linking fails If you run nm on the static lib you will see that they are not there.

I think the simplest way of seeing what is implemented is to use the following

Code: Select all

nm --demangle=gnu /opt/vc/lib/libGLESv2_static.a | c++filt 
On my build on the static lib has the symbols in as the dynamic seems to have been striped (latest wheezy beta)

Jon

Re: GL extensions

Posted: Sun Jun 24, 2012 9:04 am
by RichardUK
Thanks Jon, I'll have a look at that. Must be something in the BC headers that enables the extensions they support.

Re: GL extensions

Posted: Sun Jun 24, 2012 11:29 pm
by dattrax
The extension headers are generic.

To find the supported extensions, you need to call glGetString() with GL_EXTENSIONS. You can then do a eglGetProcAddress().

VAO's are not supported.

Jim

Re: GL extensions

Posted: Mon Jun 25, 2012 1:54 am
by adammw
Check http://elinux.org/RPi_VideoCore_APIs#OpenGL_ES or http://www.raspberrypi.org/phpBB3/viewt ... 318#p36318, they should list the extensions that are reported as supported by the pre-compiled libraries.