Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
[WebKit-https.git] / Source / WebCore / platform / graphics / OpenGLShims.h
1 /*
2  *  Copyright (C) 2010 Tieto Corporation.
3  *  Copyright (C) 2011 Igalia S.L.
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public
7  *  License as published by the Free Software Foundation; either
8  *  version 2.1 of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #ifndef OpenGLShims_h
21 #define OpenGLShims_h
22
23 #include <GL/gl.h>
24 #include <GL/glext.h>
25
26 #if defined(GL_ES_VERSION_2_0)
27 // Some openGL ES systems miss this typedef.
28 typedef char GLchar;
29 #endif
30
31 typedef struct _OpenGLFunctionTable OpenGLFunctionTable;
32
33 namespace WebCore {
34 bool initializeOpenGLShims();
35 OpenGLFunctionTable* openGLFunctionTable();
36 }
37
38 #if OS(WINDOWS)
39 #define GLAPIENTRY __stdcall
40 #else
41 #define GLAPIENTRY
42 #endif
43
44 typedef void (GLAPIENTRY *glActiveTextureType) (GLenum);
45 typedef void (GLAPIENTRY *glAttachShaderType) (GLuint, GLuint);
46 typedef void (GLAPIENTRY *glBindAttribLocationType) (GLuint, GLuint, const char*);
47 typedef void (GLAPIENTRY *glBindBufferType) (GLenum, GLuint);
48 typedef void (GLAPIENTRY *glBindFramebufferType) (GLenum, GLuint);
49 typedef void (GLAPIENTRY *glBindRenderbufferType) (GLenum, GLuint);
50 typedef void (GLAPIENTRY *glBindVertexArrayType) (GLuint);
51 typedef void (GLAPIENTRY *glBlendColorType) (GLclampf, GLclampf, GLclampf, GLclampf);
52 typedef void (GLAPIENTRY *glBlendEquationType) (GLenum);
53 typedef void (GLAPIENTRY *glBlendEquationSeparateType)(GLenum, GLenum);
54 typedef void (GLAPIENTRY *glBlendFuncSeparateType)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
55 typedef void (GLAPIENTRY *glBlitFramebufferType) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
56 typedef void (GLAPIENTRY *glBufferDataType) (GLenum, GLsizeiptr, const GLvoid*, GLenum);
57 typedef void (GLAPIENTRY *glBufferSubDataType) (GLenum, GLintptr, GLsizeiptr, const GLvoid*);
58 typedef GLenum (GLAPIENTRY *glCheckFramebufferStatusType) (GLenum);
59 typedef void (GLAPIENTRY *glCompileShaderType) (GLuint);
60 typedef void (GLAPIENTRY *glCompressedTexImage2DType) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
61 typedef void (GLAPIENTRY *glCompressedTexSubImage2DType) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
62 typedef GLuint (GLAPIENTRY *glCreateProgramType) ();
63 typedef GLuint (GLAPIENTRY *glCreateShaderType) (GLenum);
64 typedef void (GLAPIENTRY *glDeleteBuffersType) (GLsizei, const GLuint*);
65 typedef void (GLAPIENTRY *glDeleteFramebuffersType) (GLsizei n, const GLuint*);
66 typedef void (GLAPIENTRY *glDeleteProgramType) (GLuint);
67 typedef void (GLAPIENTRY *glDeleteRenderbuffersType) (GLsizei n, const GLuint*);
68 typedef void (GLAPIENTRY *glDeleteShaderType) (GLuint);
69 typedef void (GLAPIENTRY *glDeleteVertexArraysType) (GLsizei, const GLuint*);
70 typedef void (GLAPIENTRY *glDetachShaderType) (GLuint, GLuint);
71 typedef void (GLAPIENTRY *glDisableVertexAttribArrayType) (GLuint);
72 typedef void (GLAPIENTRY *glDrawArraysInstancedType) (GLenum, GLint, GLsizei, GLsizei);
73 typedef void (GLAPIENTRY *glDrawBuffersType) (GLsizei, const GLenum*);
74 typedef void (GLAPIENTRY *glDrawElementsInstancedType) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei);
75 typedef void (GLAPIENTRY *glEnableVertexAttribArrayType) (GLuint);
76 typedef void (GLAPIENTRY *glFramebufferRenderbufferType) (GLenum, GLenum, GLenum, GLuint);
77 typedef void (GLAPIENTRY *glFramebufferTexture2DType) (GLenum, GLenum, GLenum, GLuint, GLint);
78 typedef void (GLAPIENTRY *glGenBuffersType) (GLsizei, GLuint*);
79 typedef void (GLAPIENTRY *glGenerateMipmapType) (GLenum target);
80 typedef void (GLAPIENTRY *glGenFramebuffersType) (GLsizei, GLuint*);
81 typedef void (GLAPIENTRY *glGenRenderbuffersType) (GLsizei, GLuint*);
82 typedef void (GLAPIENTRY *glGenVertexArraysType) (GLsizei, GLuint*);
83 typedef void (GLAPIENTRY *glGetActiveAttribType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
84 typedef void (GLAPIENTRY *glGetActiveUniformType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
85 typedef void (GLAPIENTRY *glGetAttachedShadersType) (GLuint, GLsizei, GLsizei*, GLuint*);
86 typedef GLint (GLAPIENTRY *glGetAttribLocationType) (GLuint, const char*);
87 typedef void (GLAPIENTRY *glGetBufferParameterivType) (GLenum, GLenum, GLint*);
88 typedef void (GLAPIENTRY *glGetFramebufferAttachmentParameterivType) (GLenum, GLenum, GLenum, GLint* params);
89 typedef void (GLAPIENTRY *glGetProgramInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
90 typedef void (GLAPIENTRY *glGetProgramivType) (GLuint, GLenum, GLint*);
91 typedef void (GLAPIENTRY *glGetRenderbufferParameterivType) (GLenum, GLenum, GLint*);
92 typedef void (GLAPIENTRY *glGetShaderInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
93 typedef void (GLAPIENTRY *glGetShaderivType) (GLuint, GLenum, GLint*);
94 typedef void (GLAPIENTRY *glGetShaderSourceType) (GLuint, GLsizei, GLsizei*, char*);
95 typedef GLint (GLAPIENTRY *glGetUniformLocationType) (GLuint, const char*);
96 typedef void (GLAPIENTRY *glGetUniformfvType) (GLuint, GLint, GLfloat*);
97 typedef void (GLAPIENTRY *glGetUniformivType) (GLuint, GLint, GLint*);
98 typedef void (GLAPIENTRY *glGetVertexAttribfvType) (GLuint, GLenum, GLfloat*);
99 typedef void (GLAPIENTRY *glGetVertexAttribivType) (GLuint, GLenum, GLint*);
100 typedef void (GLAPIENTRY *glGetVertexAttribPointervType) (GLuint, GLenum, GLvoid**);
101 typedef GLboolean (GLAPIENTRY *glIsBufferType) (GLuint);
102 typedef GLboolean (GLAPIENTRY *glIsFramebufferType) (GLuint);
103 typedef GLboolean (GLAPIENTRY *glIsProgramType) (GLuint);
104 typedef GLboolean (GLAPIENTRY *glIsRenderbufferType) (GLuint);
105 typedef GLboolean (GLAPIENTRY *glIsShaderType) (GLuint);
106 typedef GLboolean (GLAPIENTRY *glIsVertexArrayType) (GLuint);
107 typedef void (GLAPIENTRY *glLinkProgramType) (GLuint);
108 typedef void (GLAPIENTRY *glRenderbufferStorageType) (GLenum, GLenum, GLsizei, GLsizei);
109 typedef void (GLAPIENTRY *glRenderbufferStorageMultisampleType) (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
110 typedef void (GLAPIENTRY *glSampleCoverageType) (GLclampf, GLboolean);
111 typedef void (GLAPIENTRY *glShaderSourceType) (GLuint, GLsizei, const char**, const GLint*);
112 typedef void (GLAPIENTRY *glStencilFuncSeparateType) (GLenum, GLenum, GLint, GLuint);
113 typedef void (GLAPIENTRY *glStencilMaskSeparateType) (GLenum, GLuint);
114 typedef void (GLAPIENTRY *glStencilOpSeparateType) (GLenum, GLenum, GLenum, GLenum);
115 typedef void (GLAPIENTRY *glUniform1fType) (GLint, GLfloat);
116 typedef void (GLAPIENTRY *glUniform1fvType) (GLint, GLsizei, const GLfloat*);
117 typedef void (GLAPIENTRY *glUniform1iType) (GLint, GLint);
118 typedef void (GLAPIENTRY *glUniform1ivType) (GLint, GLsizei, const GLint*);
119 typedef void (GLAPIENTRY *glUniform2fType) (GLint, GLfloat, GLfloat);
120 typedef void (GLAPIENTRY *glUniform2fvType) (GLint, GLsizei, const GLfloat*);
121 typedef void (GLAPIENTRY *glUniform2iType) (GLint, GLint, GLint);
122 typedef void (GLAPIENTRY *glUniform2ivType) (GLint, GLsizei, const GLint*);
123 typedef void (GLAPIENTRY *glUniform3fType) (GLint, GLfloat, GLfloat, GLfloat);
124 typedef void (GLAPIENTRY *glUniform3fvType) (GLint, GLsizei, const GLfloat*);
125 typedef void (GLAPIENTRY *glUniform3iType) (GLint, GLint, GLint, GLint);
126 typedef void (GLAPIENTRY *glUniform3ivType) (GLint, GLsizei, const GLint*);
127 typedef void (GLAPIENTRY *glUniform4fType) (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
128 typedef void (GLAPIENTRY *glUniform4fvType) (GLint, GLsizei, const GLfloat*);
129 typedef void (GLAPIENTRY *glUniform4iType) (GLint, GLint, GLint, GLint, GLint);
130 typedef void (GLAPIENTRY *glUniform4ivType) (GLint, GLsizei, const GLint*);
131 typedef void (GLAPIENTRY *glUniformMatrix2fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
132 typedef void (GLAPIENTRY *glUniformMatrix3fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
133 typedef void (GLAPIENTRY *glUniformMatrix4fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
134 typedef void (GLAPIENTRY *glUseProgramType) (GLuint);
135 typedef void (GLAPIENTRY *glValidateProgramType) (GLuint);
136 typedef void (GLAPIENTRY *glVertexAttrib1fType) (GLuint, const GLfloat);
137 typedef void (GLAPIENTRY *glVertexAttrib1fvType) (GLuint, const GLfloat*);
138 typedef void (GLAPIENTRY *glVertexAttrib2fType) (GLuint, const GLfloat, const GLfloat);
139 typedef void (GLAPIENTRY *glVertexAttrib2fvType) (GLuint, const GLfloat*);
140 typedef void (GLAPIENTRY *glVertexAttrib3fType) (GLuint, const GLfloat, const GLfloat, const GLfloat);
141 typedef void (GLAPIENTRY *glVertexAttrib3fvType) (GLuint, const GLfloat*);
142 typedef void (GLAPIENTRY *glVertexAttrib4fType) (GLuint, const GLfloat, const GLfloat, const GLfloat, const GLfloat);
143 typedef void (GLAPIENTRY *glVertexAttrib4fvType) (GLuint, const GLfloat*);
144 typedef void (GLAPIENTRY *glVertexAttribDivisorType) (GLuint, GLuint);
145 typedef void (GLAPIENTRY *glVertexAttribPointerType) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
146
147 #define FUNCTION_TABLE_ENTRY(FunctionName) FunctionName##Type FunctionName
148
149 typedef struct _OpenGLFunctionTable {
150     FUNCTION_TABLE_ENTRY(glActiveTexture);
151     FUNCTION_TABLE_ENTRY(glAttachShader);
152     FUNCTION_TABLE_ENTRY(glBindAttribLocation);
153     FUNCTION_TABLE_ENTRY(glBindBuffer);
154     FUNCTION_TABLE_ENTRY(glBindFramebuffer);
155     FUNCTION_TABLE_ENTRY(glBindRenderbuffer);
156     FUNCTION_TABLE_ENTRY(glBindVertexArray);
157     FUNCTION_TABLE_ENTRY(glBlendColor);
158     FUNCTION_TABLE_ENTRY(glBlendEquation);
159     FUNCTION_TABLE_ENTRY(glBlendEquationSeparate);
160     FUNCTION_TABLE_ENTRY(glBlendFuncSeparate);
161     FUNCTION_TABLE_ENTRY(glBlitFramebuffer);
162     FUNCTION_TABLE_ENTRY(glBufferData);
163     FUNCTION_TABLE_ENTRY(glBufferSubData);
164     FUNCTION_TABLE_ENTRY(glCheckFramebufferStatus);
165     FUNCTION_TABLE_ENTRY(glCompileShader);
166     FUNCTION_TABLE_ENTRY(glCompressedTexImage2D);
167     FUNCTION_TABLE_ENTRY(glCompressedTexSubImage2D);
168     FUNCTION_TABLE_ENTRY(glCreateProgram);
169     FUNCTION_TABLE_ENTRY(glCreateShader);
170     FUNCTION_TABLE_ENTRY(glDeleteBuffers);
171     FUNCTION_TABLE_ENTRY(glDeleteFramebuffers);
172     FUNCTION_TABLE_ENTRY(glDeleteProgram);
173     FUNCTION_TABLE_ENTRY(glDeleteRenderbuffers);
174     FUNCTION_TABLE_ENTRY(glDeleteShader);
175     FUNCTION_TABLE_ENTRY(glDeleteVertexArrays);
176     FUNCTION_TABLE_ENTRY(glDetachShader);
177     FUNCTION_TABLE_ENTRY(glDisableVertexAttribArray);
178     FUNCTION_TABLE_ENTRY(glDrawArraysInstanced);
179     FUNCTION_TABLE_ENTRY(glDrawBuffers);
180     FUNCTION_TABLE_ENTRY(glDrawElementsInstanced);
181     FUNCTION_TABLE_ENTRY(glEnableVertexAttribArray);
182     FUNCTION_TABLE_ENTRY(glFramebufferRenderbuffer);
183     FUNCTION_TABLE_ENTRY(glFramebufferTexture2D);
184     FUNCTION_TABLE_ENTRY(glGenBuffers);
185     FUNCTION_TABLE_ENTRY(glGenerateMipmap);
186     FUNCTION_TABLE_ENTRY(glGenFramebuffers);
187     FUNCTION_TABLE_ENTRY(glGenRenderbuffers);
188     FUNCTION_TABLE_ENTRY(glGenVertexArrays);
189     FUNCTION_TABLE_ENTRY(glGetActiveAttrib);
190     FUNCTION_TABLE_ENTRY(glGetActiveUniform);
191     FUNCTION_TABLE_ENTRY(glGetAttachedShaders);
192     FUNCTION_TABLE_ENTRY(glGetAttribLocation);
193     FUNCTION_TABLE_ENTRY(glGetBufferParameteriv);
194     FUNCTION_TABLE_ENTRY(glGetFramebufferAttachmentParameteriv);
195     FUNCTION_TABLE_ENTRY(glGetProgramInfoLog);
196     FUNCTION_TABLE_ENTRY(glGetProgramiv);
197     FUNCTION_TABLE_ENTRY(glGetRenderbufferParameteriv);
198     FUNCTION_TABLE_ENTRY(glGetShaderInfoLog);
199     FUNCTION_TABLE_ENTRY(glGetShaderiv);
200     FUNCTION_TABLE_ENTRY(glGetShaderSource);
201     FUNCTION_TABLE_ENTRY(glGetUniformfv);
202     FUNCTION_TABLE_ENTRY(glGetUniformiv);
203     FUNCTION_TABLE_ENTRY(glGetUniformLocation);
204     FUNCTION_TABLE_ENTRY(glGetVertexAttribfv);
205     FUNCTION_TABLE_ENTRY(glGetVertexAttribiv);
206     FUNCTION_TABLE_ENTRY(glGetVertexAttribPointerv);
207     FUNCTION_TABLE_ENTRY(glIsBuffer);
208     FUNCTION_TABLE_ENTRY(glIsFramebuffer);
209     FUNCTION_TABLE_ENTRY(glIsProgram);
210     FUNCTION_TABLE_ENTRY(glIsRenderbuffer);
211     FUNCTION_TABLE_ENTRY(glIsShader);
212     FUNCTION_TABLE_ENTRY(glIsVertexArray);
213     FUNCTION_TABLE_ENTRY(glLinkProgram);
214     FUNCTION_TABLE_ENTRY(glRenderbufferStorage);
215     FUNCTION_TABLE_ENTRY(glRenderbufferStorageMultisample);
216     FUNCTION_TABLE_ENTRY(glSampleCoverage);
217     FUNCTION_TABLE_ENTRY(glShaderSource);
218     FUNCTION_TABLE_ENTRY(glStencilFuncSeparate);
219     FUNCTION_TABLE_ENTRY(glStencilMaskSeparate);
220     FUNCTION_TABLE_ENTRY(glStencilOpSeparate);
221     FUNCTION_TABLE_ENTRY(glUniform1f);
222     FUNCTION_TABLE_ENTRY(glUniform1fv);
223     FUNCTION_TABLE_ENTRY(glUniform1i);
224     FUNCTION_TABLE_ENTRY(glUniform1iv);
225     FUNCTION_TABLE_ENTRY(glUniform2f);
226     FUNCTION_TABLE_ENTRY(glUniform2fv);
227     FUNCTION_TABLE_ENTRY(glUniform2i);
228     FUNCTION_TABLE_ENTRY(glUniform2iv);
229     FUNCTION_TABLE_ENTRY(glUniform3f);
230     FUNCTION_TABLE_ENTRY(glUniform3fv);
231     FUNCTION_TABLE_ENTRY(glUniform3i);
232     FUNCTION_TABLE_ENTRY(glUniform3iv);
233     FUNCTION_TABLE_ENTRY(glUniform4f);
234     FUNCTION_TABLE_ENTRY(glUniform4fv);
235     FUNCTION_TABLE_ENTRY(glUniform4i);
236     FUNCTION_TABLE_ENTRY(glUniform4iv);
237     FUNCTION_TABLE_ENTRY(glUniformMatrix2fv);
238     FUNCTION_TABLE_ENTRY(glUniformMatrix3fv);
239     FUNCTION_TABLE_ENTRY(glUniformMatrix4fv);
240     FUNCTION_TABLE_ENTRY(glUseProgram);
241     FUNCTION_TABLE_ENTRY(glValidateProgram);
242     FUNCTION_TABLE_ENTRY(glVertexAttrib1f);
243     FUNCTION_TABLE_ENTRY(glVertexAttrib1fv);
244     FUNCTION_TABLE_ENTRY(glVertexAttrib2f);
245     FUNCTION_TABLE_ENTRY(glVertexAttrib2fv);
246     FUNCTION_TABLE_ENTRY(glVertexAttrib3f);
247     FUNCTION_TABLE_ENTRY(glVertexAttrib3fv);
248     FUNCTION_TABLE_ENTRY(glVertexAttrib4f);
249     FUNCTION_TABLE_ENTRY(glVertexAttrib4fv);
250     FUNCTION_TABLE_ENTRY(glVertexAttribDivisor);
251     FUNCTION_TABLE_ENTRY(glVertexAttribPointer);
252 } OpenGLFunctionTable;
253
254 // We disable the shims for OpenGLShims.cpp, so that we can set them.
255 #ifndef DISABLE_SHIMS
256 #define LOOKUP_GL_FUNCTION(Function) WebCore::openGLFunctionTable()->Function
257 #define glActiveTexture                        LOOKUP_GL_FUNCTION(glActiveTexture)
258 #define glAttachShader                         LOOKUP_GL_FUNCTION(glAttachShader)
259 #define glBindAttribLocation                   LOOKUP_GL_FUNCTION(glBindAttribLocation)
260 #define glBindBuffer                           LOOKUP_GL_FUNCTION(glBindBuffer)
261 #define glBindFramebufferEXT                   glBindFramebuffer
262 #define glBindFramebuffer                      LOOKUP_GL_FUNCTION(glBindFramebuffer)
263 #define glBindRenderbufferEXT                  glBindRenderbuffer
264 #define glBindRenderbuffer                     LOOKUP_GL_FUNCTION(glBindRenderbuffer)
265 #define glBindVertexArrayOES                   glBindVertexArray
266 #define glBindVertexArray                      LOOKUP_GL_FUNCTION(glBindVertexArray)
267 #define glBlendColor                           LOOKUP_GL_FUNCTION(glBlendColor)
268 #define glBlendEquation                        LOOKUP_GL_FUNCTION(glBlendEquation)
269 #define glBlendEquationSeparate                LOOKUP_GL_FUNCTION(glBlendEquationSeparate)
270 #define glBlendFuncSeparate                    LOOKUP_GL_FUNCTION(glBlendFuncSeparate)
271 #define glBlitFramebufferEXT                   glBlitFramebuffer
272 #define glBlitFramebuffer                      LOOKUP_GL_FUNCTION(glBlitFramebuffer)
273 #define glBufferData                           LOOKUP_GL_FUNCTION(glBufferData)
274 #define glBufferSubData                        LOOKUP_GL_FUNCTION(glBufferSubData)
275 #define glCheckFramebufferStatusEXT            glCheckFramebufferStatus
276 #define glCheckFramebufferStatus               LOOKUP_GL_FUNCTION(glCheckFramebufferStatus)
277 #define glCompileShader                        LOOKUP_GL_FUNCTION(glCompileShader)
278 #define glCompressedTexImage2D                 LOOKUP_GL_FUNCTION(glCompressedTexImage2D)
279 #define glCompressedTexSubImage2D              LOOKUP_GL_FUNCTION(glCompressedTexSubImage2D)
280 #define glCreateProgram                        LOOKUP_GL_FUNCTION(glCreateProgram)
281 #define glCreateShader                         LOOKUP_GL_FUNCTION(glCreateShader)
282 #define glDeleteBuffers                        LOOKUP_GL_FUNCTION(glDeleteBuffers)
283 #define glDeleteFramebuffersEXT                glDeleteFramebuffers
284 #define glDeleteFramebuffers                   LOOKUP_GL_FUNCTION(glDeleteFramebuffers)
285 #define glDeleteProgram                        LOOKUP_GL_FUNCTION(glDeleteProgram)
286 #define glDeleteRenderbuffersEXT               glDeleteRenderbuffers
287 #define glDeleteRenderbuffers                  LOOKUP_GL_FUNCTION(glDeleteRenderbuffers)
288 #define glDeleteShader                         LOOKUP_GL_FUNCTION(glDeleteShader)
289 #define glDeleteVertexArraysOES                glDeleteVertexArrays
290 #define glDeleteVertexArrays                   LOOKUP_GL_FUNCTION(glDeleteVertexArrays)
291 #define glDetachShader                         LOOKUP_GL_FUNCTION(glDetachShader)
292 #define glDisableVertexAttribArray             LOOKUP_GL_FUNCTION(glDisableVertexAttribArray)
293 #define glDrawArraysInstancedEXT               glDrawArraysInstanced
294 #define glDrawArraysInstanced                  LOOKUP_GL_FUNCTION(glDrawArraysInstanced)
295 #define glDrawBuffersEXT                       glDrawBuffers
296 #define glDrawBuffers                          LOOKUP_GL_FUNCTION(glDrawBuffers)
297 #define glDrawElementsInstancedEXT             glDrawElementsInstanced
298 #define glDrawElementsInstanced                LOOKUP_GL_FUNCTION(glDrawElementsInstanced)
299 #define glEnableVertexAttribArray              LOOKUP_GL_FUNCTION(glEnableVertexAttribArray)
300 #define glFramebufferRenderbufferEXT           glFramebufferRenderbuffer
301 #define glFramebufferRenderbuffer              LOOKUP_GL_FUNCTION(glFramebufferRenderbuffer)
302 #define glFramebufferTexture2DEXT              glFramebufferTexture2D
303 #define glFramebufferTexture2D                 LOOKUP_GL_FUNCTION(glFramebufferTexture2D)
304 #define glGenBuffers                           LOOKUP_GL_FUNCTION(glGenBuffers)
305 #define glGenerateMipmapEXT                    glGenerateMipmap
306 #define glGenerateMipmap                       LOOKUP_GL_FUNCTION(glGenerateMipmap)
307 #define glGenFramebuffersEXT                   glGenFramebuffers
308 #define glGenFramebuffers                      LOOKUP_GL_FUNCTION(glGenFramebuffers)
309 #define glGenRenderbuffersEXT                  glGenRenderbuffers
310 #define glGenRenderbuffers                     LOOKUP_GL_FUNCTION(glGenRenderbuffers)
311 #define glGenVertexArraysOES                   glGenVertexArrays;
312 #define glGenVertexArrays                      LOOKUP_GL_FUNCTION(glGenVertexArrays)
313 #define glGetActiveAttrib                      LOOKUP_GL_FUNCTION(glGetActiveAttrib)
314 #define glGetActiveUniform                     LOOKUP_GL_FUNCTION(glGetActiveUniform)
315 #define glGetAttachedShaders                   LOOKUP_GL_FUNCTION(glGetAttachedShaders)
316 #define glGetAttribLocation                    LOOKUP_GL_FUNCTION(glGetAttribLocation)
317 #define glGetBufferParameterivEXT              glGetBufferParameteriv
318 #define glGetBufferParameteriv                 LOOKUP_GL_FUNCTION(glGetBufferParameteriv)
319 #define glGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
320 #define glGetFramebufferAttachmentParameteriv  LOOKUP_GL_FUNCTION(glGetFramebufferAttachmentParameteriv)
321 #define glGetProgramInfoLog                    LOOKUP_GL_FUNCTION(glGetProgramInfoLog)
322 #define glGetProgramiv                         LOOKUP_GL_FUNCTION(glGetProgramiv)
323 #define glGetRenderbufferParameterivEXT        glGetRenderbufferParameteriv
324 #define glGetRenderbufferParameteriv           LOOKUP_GL_FUNCTION(glGetRenderbufferParameteriv)
325 #define glGetShaderInfoLog                     LOOKUP_GL_FUNCTION(glGetShaderInfoLog)
326 #define glGetShaderiv                          LOOKUP_GL_FUNCTION(glGetShaderiv)
327 #define glGetShaderSource                      LOOKUP_GL_FUNCTION(glGetShaderSource)
328 #define glGetUniformfv                         LOOKUP_GL_FUNCTION(glGetUniformfv)
329 #define glGetUniformiv                         LOOKUP_GL_FUNCTION(glGetUniformiv)
330 #define glGetUniformLocation                   LOOKUP_GL_FUNCTION(glGetUniformLocation)
331 #define glGetVertexAttribfv                    LOOKUP_GL_FUNCTION(glGetVertexAttribfv)
332 #define glGetVertexAttribiv                    LOOKUP_GL_FUNCTION(glGetVertexAttribiv)
333 #define glGetVertexAttribPointerv              LOOKUP_GL_FUNCTION(glGetVertexAttribPointerv)
334 #define glIsBuffer                             LOOKUP_GL_FUNCTION(glIsBuffer)
335 #define glIsFramebufferEXT                     glIsFramebuffer
336 #define glIsFramebuffer                        LOOKUP_GL_FUNCTION(glIsFramebuffer)
337 #define glIsProgram                            LOOKUP_GL_FUNCTION(glIsProgram)
338 #define glIsRenderbufferEXT                    glIsRenderbuffer
339 #define glIsRenderbuffer                       LOOKUP_GL_FUNCTION(glIsRenderbuffer)
340 #define glIsShader                             LOOKUP_GL_FUNCTION(glIsShader)
341 #define glIsVertexArrayOES                     glIsVertexArray;
342 #define glIsVertexArray                        LOOKUP_GL_FUNCTION(glIsVertexArray)
343 #define glLinkProgram                          LOOKUP_GL_FUNCTION(glLinkProgram)
344 #define glRenderbufferStorageEXT               glRenderbufferStorage
345 #define glRenderbufferStorage                  LOOKUP_GL_FUNCTION(glRenderbufferStorage)
346 #define glRenderbufferStorageMultisampleEXT    glRenderbufferStorageMultisample
347 #define glRenderbufferStorageMultisample       LOOKUP_GL_FUNCTION(glRenderbufferStorageMultisample)
348 #define glSampleCoverage                       LOOKUP_GL_FUNCTION(glSampleCoverage)
349 #define glShaderSource                         LOOKUP_GL_FUNCTION(glShaderSource)
350 #define glStencilFuncSeparate                  LOOKUP_GL_FUNCTION(glStencilFuncSeparate)
351 #define glStencilMaskSeparate                  LOOKUP_GL_FUNCTION(glStencilMaskSeparate)
352 #define glStencilOpSeparate                    LOOKUP_GL_FUNCTION(glStencilOpSeparate)
353 #define glUniform1f                            LOOKUP_GL_FUNCTION(glUniform1f)
354 #define glUniform1fv                           LOOKUP_GL_FUNCTION(glUniform1fv)
355 #define glUniform1i                            LOOKUP_GL_FUNCTION(glUniform1i)
356 #define glUniform1iv                           LOOKUP_GL_FUNCTION(glUniform1iv)
357 #define glUniform2f                            LOOKUP_GL_FUNCTION(glUniform2f)
358 #define glUniform2fv                           LOOKUP_GL_FUNCTION(glUniform2fv)
359 #define glUniform2i                            LOOKUP_GL_FUNCTION(glUniform2i)
360 #define glUniform2iv                           LOOKUP_GL_FUNCTION(glUniform2iv)
361 #define glUniform3f                            LOOKUP_GL_FUNCTION(glUniform3f)
362 #define glUniform3fv                           LOOKUP_GL_FUNCTION(glUniform3fv)
363 #define glUniform3i                            LOOKUP_GL_FUNCTION(glUniform3i)
364 #define glUniform3iv                           LOOKUP_GL_FUNCTION(glUniform3iv)
365 #define glUniform4f                            LOOKUP_GL_FUNCTION(glUniform4f)
366 #define glUniform4fv                           LOOKUP_GL_FUNCTION(glUniform4fv)
367 #define glUniform4i                            LOOKUP_GL_FUNCTION(glUniform4i)
368 #define glUniform4iv                           LOOKUP_GL_FUNCTION(glUniform4iv)
369 #define glUniformMatrix2fv                     LOOKUP_GL_FUNCTION(glUniformMatrix2fv)
370 #define glUniformMatrix3fv                     LOOKUP_GL_FUNCTION(glUniformMatrix3fv)
371 #define glUniformMatrix4fv                     LOOKUP_GL_FUNCTION(glUniformMatrix4fv)
372 #define glUseProgram                           LOOKUP_GL_FUNCTION(glUseProgram)
373 #define glValidateProgram                      LOOKUP_GL_FUNCTION(glValidateProgram)
374 #define glVertexAttrib1f                       LOOKUP_GL_FUNCTION(glVertexAttrib1f)
375 #define glVertexAttrib1fv                      LOOKUP_GL_FUNCTION(glVertexAttrib1fv)
376 #define glVertexAttrib2f                       LOOKUP_GL_FUNCTION(glVertexAttrib2f)
377 #define glVertexAttrib2fv                      LOOKUP_GL_FUNCTION(glVertexAttrib2fv)
378 #define glVertexAttrib3f                       LOOKUP_GL_FUNCTION(glVertexAttrib3f)
379 #define glVertexAttrib3fv                      LOOKUP_GL_FUNCTION(glVertexAttrib3fv)
380 #define glVertexAttrib4f                       LOOKUP_GL_FUNCTION(glVertexAttrib4f)
381 #define glVertexAttrib4fv                      LOOKUP_GL_FUNCTION(glVertexAttrib4fv)
382 #define glVertexAttribDivisorEXT               glVertexAttribDivisor
383 #define glVertexAttribDivisor                  LOOKUP_GL_FUNCTION(glVertexAttribDivisor)
384 #define glVertexAttribPointer                  LOOKUP_GL_FUNCTION(glVertexAttribPointer)
385 #endif
386
387 #endif