How to use OpenGL ES 2.0 “GL_OES_vertex_array_object” extension

Document created by Xiong Xiao Employee on Jul 9, 2014
Version 1Show Document
  • View in full screen mode

If someone wants to use the OpenGL ES 2.0 extension "GL_OES_vertex_array_object", the macro "GL_GLEXT_PROTOTYPES" must be defined in his program first. Then he can get the extension program location by calling the API eglGetProcAddress.  Here is an example to use this extension.

#define GL_GLEXT_PROTOTYPES

PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESv;

PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESv;

PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESv;

 

glGenVertexArraysOESv = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress ( "glGenVertexArraysOES" );

glBindVertexArrayOESv = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress ( "glBindVertexArrayOES" );

glDeleteVertexArraysOESv = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress ( "glDeleteVertexArraysOES" );

After these steps, the new alias glGenVertexArraysOESv, glBindVertexArrayOESv, glDeleteVertexArraysOESv can be use to call the VAO operation function in OpenGL ES 2.0 extensions.

Attachments

    Outcomes