How to use OpenGL ES 2.0 “GL_OES_vertex_array_object” extension

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use OpenGL ES 2.0 “GL_OES_vertex_array_object” extension

How to use OpenGL ES 2.0 “GL_OES_vertex_array_object” extension

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.

Labels (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1117866%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20use%20OpenGL%20ES%202.0%20%E2%80%9CGL_OES_vertex_array_object%E2%80%9D%20extension%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1117866%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20someone%20wants%20to%20use%20the%20OpenGL%20ES%202.0%20extension%20%22GL_OES_vertex_array_object%22%2C%20the%20macro%20%22%3CSPAN%20style%3D%22font-size%3A%2011.0pt%3B%20font-family%3A%20'Calibri'%2C'sans-serif'%3B%20color%3A%20%231f497d%3B%22%3EGL_GLEXT_PROTOTYPES%3C%2FSPAN%3E%22%20must%20be%20defined%20in%20his%20program%20first.%20Then%20he%20can%20get%20the%20extension%20program%20location%20by%20calling%20the%20API%20eglGetProcAddress.%26nbsp%3B%20Here%20is%20an%20example%20to%20use%20this%20extension.%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3E%23define%20GL_GLEXT_PROTOTYPES%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EPFNGLGENVERTEXARRAYSOESPROC%20glGenVertexArraysOESv%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EPFNGLBINDVERTEXARRAYOESPROC%20glBindVertexArrayOESv%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EPFNGLDELETEVERTEXARRAYSOESPROC%20glDeleteVertexArraysOESv%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EglGenVertexArraysOESv%20%3D%20(PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress%20(%20%22glGenVertexArraysOES%22%20)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EglBindVertexArrayOESv%20%3D%20(PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress%20(%20%22glBindVertexArrayOES%22%20)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22background%3A%20%23EEEEEE%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.5pt%3B%20font-family%3A%20Consolas%3B%20color%3A%20black%3B%20background-position%3A%20initial%3B%22%3EglDeleteVertexArraysOESv%20%3D%20(PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress%20(%20%22glDeleteVertexArraysOES%22%20)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAfter%20these%20steps%2C%20the%20new%20alias%20glGenVertexArraysOESv%2C%20glBindVertexArrayOESv%2C%20glDeleteVertexArraysOESv%20can%20be%20use%20to%20call%20the%20VAO%20operation%20function%20in%20OpenGL%20ES%202.0%20extensions.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1117866%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EGraphics%20%26amp%3B%20Display%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎07-09-2014 12:30 AM
Updated by: