[WebGL][EFL][GTK][Qt]Add support for OES_vertex_array_object.
[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 #if PLATFORM(QT)
24 #include <qglobal.h>
25 #include <qopenglfunctions.h>
26 #include <QOpenGLContext>
27 #include <QSurface>
28 #else
29 #include <GL/gl.h>
30 #endif
31
32 #if defined(GL_ES_VERSION_2_0)
33 // Some openGL ES systems miss this typedef.
34 typedef char GLchar;
35 #endif
36
37 typedef struct _OpenGLFunctionTable OpenGLFunctionTable;
38
39 namespace WebCore {
40 bool initializeOpenGLShims();
41 OpenGLFunctionTable* openGLFunctionTable();
42 }
43
44 #if OS(WINDOWS)
45 #define GLAPIENTRY __stdcall
46 #else
47 #define GLAPIENTRY
48 #endif
49
50 typedef void (GLAPIENTRY *glActiveTextureType) (GLenum);
51 typedef void (GLAPIENTRY *glAttachShaderType) (GLuint, GLuint);
52 typedef void (GLAPIENTRY *glBindAttribLocationType) (GLuint, GLuint, const char*);
53 typedef void (GLAPIENTRY *glBindBufferType) (GLenum, GLuint);
54 typedef void (GLAPIENTRY *glBindFramebufferType) (GLenum, GLuint);
55 typedef void (GLAPIENTRY *glBindRenderbufferType) (GLenum, GLuint);
56 typedef void (GLAPIENTRY *glBindVertexArrayType) (GLuint);
57 typedef void (GLAPIENTRY *glBlendColorType) (GLclampf, GLclampf, GLclampf, GLclampf);
58 typedef void (GLAPIENTRY *glBlendEquationType) (GLenum);
59 typedef void (GLAPIENTRY *glBlendEquationSeparateType)(GLenum, GLenum);
60 typedef void (GLAPIENTRY *glBlendFuncSeparateType)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
61 typedef void (GLAPIENTRY *glBlitFramebufferType) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
62 typedef void (GLAPIENTRY *glBufferDataType) (GLenum, GLsizeiptr, const GLvoid*, GLenum);
63 typedef void (GLAPIENTRY *glBufferSubDataType) (GLenum, GLintptr, GLsizeiptr, const GLvoid*);
64 typedef GLenum (GLAPIENTRY *glCheckFramebufferStatusType) (GLenum);
65 typedef void (GLAPIENTRY *glCompileShaderType) (GLuint);
66 typedef GLuint (GLAPIENTRY *glCreateProgramType) ();
67 typedef GLuint (GLAPIENTRY *glCreateShaderType) (GLenum);
68 typedef void (GLAPIENTRY *glDeleteBuffersType) (GLsizei, const GLuint*);
69 typedef void (GLAPIENTRY *glDeleteFramebuffersType) (GLsizei n, const GLuint*);
70 typedef void (GLAPIENTRY *glDeleteProgramType) (GLuint);
71 typedef void (GLAPIENTRY *glDeleteRenderbuffersType) (GLsizei n, const GLuint*);
72 typedef void (GLAPIENTRY *glDeleteShaderType) (GLuint);
73 typedef void (GLAPIENTRY *glDeleteVertexArraysType) (GLsizei, const GLuint*);
74 typedef void (GLAPIENTRY *glDetachShaderType) (GLuint, GLuint);
75 typedef void (GLAPIENTRY *glDisableVertexAttribArrayType) (GLuint);
76 typedef void (GLAPIENTRY *glEnableVertexAttribArrayType) (GLuint);
77 typedef void (GLAPIENTRY *glFramebufferRenderbufferType) (GLenum, GLenum, GLenum, GLuint);
78 typedef void (GLAPIENTRY *glFramebufferTexture2DType) (GLenum, GLenum, GLenum, GLuint, GLint);
79 typedef void (GLAPIENTRY *glGenBuffersType) (GLsizei, GLuint*);
80 typedef void (GLAPIENTRY *glGenerateMipmapType) (GLenum target);
81 typedef void (GLAPIENTRY *glGenFramebuffersType) (GLsizei, GLuint*);
82 typedef void (GLAPIENTRY *glGenRenderbuffersType) (GLsizei, GLuint*);
83 typedef void (GLAPIENTRY *glGenVertexArraysType) (GLsizei, GLuint*);
84 typedef void (GLAPIENTRY *glGetActiveAttribType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
85 typedef void (GLAPIENTRY *glGetActiveUniformType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
86 typedef void (GLAPIENTRY *glGetAttachedShadersType) (GLuint, GLsizei, GLsizei*, GLuint*);
87 typedef GLint (GLAPIENTRY *glGetAttribLocationType) (GLuint, const char*);
88 typedef void (GLAPIENTRY *glGetBufferParameterivType) (GLenum, GLenum, GLint*);
89 typedef void (GLAPIENTRY *glGetFramebufferAttachmentParameterivType) (GLenum, GLenum, GLenum, GLint* params);
90 typedef void (GLAPIENTRY *glGetProgramInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
91 typedef void (GLAPIENTRY *glGetProgramivType) (GLuint, GLenum, GLint*);
92 typedef void (GLAPIENTRY *glGetRenderbufferParameterivType) (GLenum, GLenum, GLint*);
93 typedef void (GLAPIENTRY *glGetShaderInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
94 typedef void (GLAPIENTRY *glGetShaderivType) (GLuint, GLenum, GLint*);
95 typedef void (GLAPIENTRY *glGetShaderSourceType) (GLuint, GLsizei, GLsizei*, char*);
96 typedef GLint (GLAPIENTRY *glGetUniformLocationType) (GLuint, const char*);
97 typedef void (GLAPIENTRY *glGetUniformfvType) (GLuint, GLint, GLfloat*);
98 typedef void (GLAPIENTRY *glGetUniformivType) (GLuint, GLint, GLint*);
99 typedef void (GLAPIENTRY *glGetVertexAttribfvType) (GLuint, GLenum, GLfloat*);
100 typedef void (GLAPIENTRY *glGetVertexAttribivType) (GLuint, GLenum, GLint*);
101 typedef void (GLAPIENTRY *glGetVertexAttribPointervType) (GLuint, GLenum, GLvoid**);
102 typedef GLboolean (GLAPIENTRY *glIsBufferType) (GLuint);
103 typedef GLboolean (GLAPIENTRY *glIsFramebufferType) (GLuint);
104 typedef GLboolean (GLAPIENTRY *glIsProgramType) (GLuint);
105 typedef GLboolean (GLAPIENTRY *glIsRenderbufferType) (GLuint);
106 typedef GLboolean (GLAPIENTRY *glIsShaderType) (GLuint);
107 typedef GLboolean (GLAPIENTRY *glIsVertexArrayType) (GLuint);
108 typedef void (GLAPIENTRY *glLinkProgramType) (GLuint);
109 typedef void (GLAPIENTRY *glRenderbufferStorageType) (GLenum, GLenum, GLsizei, GLsizei);
110 typedef void (GLAPIENTRY *glRenderbufferStorageMultisampleType) (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
111 typedef void (GLAPIENTRY *glSampleCoverageType) (GLclampf, GLboolean);
112 typedef void (GLAPIENTRY *glShaderSourceType) (GLuint, GLsizei, const char**, const GLint*);
113 typedef void (GLAPIENTRY *glStencilFuncSeparateType) (GLenum, GLenum, GLint, GLuint);
114 typedef void (GLAPIENTRY *glStencilMaskSeparateType) (GLenum, GLuint);
115 typedef void (GLAPIENTRY *glStencilOpSeparateType) (GLenum, GLenum, GLenum, GLenum);
116 typedef void (GLAPIENTRY *glUniform1fType) (GLint, GLfloat);
117 typedef void (GLAPIENTRY *glUniform1fvType) (GLint, GLsizei, const GLfloat*);
118 typedef void (GLAPIENTRY *glUniform1iType) (GLint, GLint);
119 typedef void (GLAPIENTRY *glUniform1ivType) (GLint, GLsizei, const GLint*);
120 typedef void (GLAPIENTRY *glUniform2fType) (GLint, GLfloat, GLfloat);
121 typedef void (GLAPIENTRY *glUniform2fvType) (GLint, GLsizei, const GLfloat*);
122 typedef void (GLAPIENTRY *glUniform2iType) (GLint, GLint, GLint);
123 typedef void (GLAPIENTRY *glUniform2ivType) (GLint, GLsizei, const GLint*);
124 typedef void (GLAPIENTRY *glUniform3fType) (GLint, GLfloat, GLfloat, GLfloat);
125 typedef void (GLAPIENTRY *glUniform3fvType) (GLint, GLsizei, const GLfloat*);
126 typedef void (GLAPIENTRY *glUniform3iType) (GLint, GLint, GLint, GLint);
127 typedef void (GLAPIENTRY *glUniform3ivType) (GLint, GLsizei, const GLint*);
128 typedef void (GLAPIENTRY *glUniform4fType) (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
129 typedef void (GLAPIENTRY *glUniform4fvType) (GLint, GLsizei, const GLfloat*);
130 typedef void (GLAPIENTRY *glUniform4iType) (GLint, GLint, GLint, GLint, GLint);
131 typedef void (GLAPIENTRY *glUniform4ivType) (GLint, GLsizei, const GLint*);
132 typedef void (GLAPIENTRY *glUniformMatrix2fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
133 typedef void (GLAPIENTRY *glUniformMatrix3fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
134 typedef void (GLAPIENTRY *glUniformMatrix4fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
135 typedef void (GLAPIENTRY *glUseProgramType) (GLuint);
136 typedef void (GLAPIENTRY *glValidateProgramType) (GLuint);
137 typedef void (GLAPIENTRY *glVertexAttrib1fType) (GLuint, const GLfloat);
138 typedef void (GLAPIENTRY *glVertexAttrib1fvType) (GLuint, const GLfloat*);
139 typedef void (GLAPIENTRY *glVertexAttrib2fType) (GLuint, const GLfloat, const GLfloat);
140 typedef void (GLAPIENTRY *glVertexAttrib2fvType) (GLuint, const GLfloat*);
141 typedef void (GLAPIENTRY *glVertexAttrib3fType) (GLuint, const GLfloat, const GLfloat, const GLfloat);
142 typedef void (GLAPIENTRY *glVertexAttrib3fvType) (GLuint, const GLfloat*);
143 typedef void (GLAPIENTRY *glVertexAttrib4fType) (GLuint, const GLfloat, const GLfloat, const GLfloat, const GLfloat);
144 typedef void (GLAPIENTRY *glVertexAttrib4fvType) (GLuint, const GLfloat*);
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(glCreateProgram);
167     FUNCTION_TABLE_ENTRY(glCreateShader);
168     FUNCTION_TABLE_ENTRY(glDeleteBuffers);
169     FUNCTION_TABLE_ENTRY(glDeleteFramebuffers);
170     FUNCTION_TABLE_ENTRY(glDeleteProgram);
171     FUNCTION_TABLE_ENTRY(glDeleteRenderbuffers);
172     FUNCTION_TABLE_ENTRY(glDeleteShader);
173     FUNCTION_TABLE_ENTRY(glDeleteVertexArrays);
174     FUNCTION_TABLE_ENTRY(glDetachShader);
175     FUNCTION_TABLE_ENTRY(glDisableVertexAttribArray);
176     FUNCTION_TABLE_ENTRY(glEnableVertexAttribArray);
177     FUNCTION_TABLE_ENTRY(glFramebufferRenderbuffer);
178     FUNCTION_TABLE_ENTRY(glFramebufferTexture2D);
179     FUNCTION_TABLE_ENTRY(glGenBuffers);
180     FUNCTION_TABLE_ENTRY(glGenerateMipmap);
181     FUNCTION_TABLE_ENTRY(glGenFramebuffers);
182     FUNCTION_TABLE_ENTRY(glGenRenderbuffers);
183     FUNCTION_TABLE_ENTRY(glGenVertexArrays);
184     FUNCTION_TABLE_ENTRY(glGetActiveAttrib);
185     FUNCTION_TABLE_ENTRY(glGetActiveUniform);
186     FUNCTION_TABLE_ENTRY(glGetAttachedShaders);
187     FUNCTION_TABLE_ENTRY(glGetAttribLocation);
188     FUNCTION_TABLE_ENTRY(glGetBufferParameteriv);
189     FUNCTION_TABLE_ENTRY(glGetFramebufferAttachmentParameteriv);
190     FUNCTION_TABLE_ENTRY(glGetProgramInfoLog);
191     FUNCTION_TABLE_ENTRY(glGetProgramiv);
192     FUNCTION_TABLE_ENTRY(glGetRenderbufferParameteriv);
193     FUNCTION_TABLE_ENTRY(glGetShaderInfoLog);
194     FUNCTION_TABLE_ENTRY(glGetShaderiv);
195     FUNCTION_TABLE_ENTRY(glGetShaderSource);
196     FUNCTION_TABLE_ENTRY(glGetUniformfv);
197     FUNCTION_TABLE_ENTRY(glGetUniformiv);
198     FUNCTION_TABLE_ENTRY(glGetUniformLocation);
199     FUNCTION_TABLE_ENTRY(glGetVertexAttribfv);
200     FUNCTION_TABLE_ENTRY(glGetVertexAttribiv);
201     FUNCTION_TABLE_ENTRY(glGetVertexAttribPointerv);
202     FUNCTION_TABLE_ENTRY(glIsBuffer);
203     FUNCTION_TABLE_ENTRY(glIsFramebuffer);
204     FUNCTION_TABLE_ENTRY(glIsProgram);
205     FUNCTION_TABLE_ENTRY(glIsRenderbuffer);
206     FUNCTION_TABLE_ENTRY(glIsShader);
207     FUNCTION_TABLE_ENTRY(glIsVertexArray);
208     FUNCTION_TABLE_ENTRY(glLinkProgram);
209     FUNCTION_TABLE_ENTRY(glRenderbufferStorage);
210     FUNCTION_TABLE_ENTRY(glRenderbufferStorageMultisample);
211     FUNCTION_TABLE_ENTRY(glSampleCoverage);
212     FUNCTION_TABLE_ENTRY(glShaderSource);
213     FUNCTION_TABLE_ENTRY(glStencilFuncSeparate);
214     FUNCTION_TABLE_ENTRY(glStencilMaskSeparate);
215     FUNCTION_TABLE_ENTRY(glStencilOpSeparate);
216     FUNCTION_TABLE_ENTRY(glUniform1f);
217     FUNCTION_TABLE_ENTRY(glUniform1fv);
218     FUNCTION_TABLE_ENTRY(glUniform1i);
219     FUNCTION_TABLE_ENTRY(glUniform1iv);
220     FUNCTION_TABLE_ENTRY(glUniform2f);
221     FUNCTION_TABLE_ENTRY(glUniform2fv);
222     FUNCTION_TABLE_ENTRY(glUniform2i);
223     FUNCTION_TABLE_ENTRY(glUniform2iv);
224     FUNCTION_TABLE_ENTRY(glUniform3f);
225     FUNCTION_TABLE_ENTRY(glUniform3fv);
226     FUNCTION_TABLE_ENTRY(glUniform3i);
227     FUNCTION_TABLE_ENTRY(glUniform3iv);
228     FUNCTION_TABLE_ENTRY(glUniform4f);
229     FUNCTION_TABLE_ENTRY(glUniform4fv);
230     FUNCTION_TABLE_ENTRY(glUniform4i);
231     FUNCTION_TABLE_ENTRY(glUniform4iv);
232     FUNCTION_TABLE_ENTRY(glUniformMatrix2fv);
233     FUNCTION_TABLE_ENTRY(glUniformMatrix3fv);
234     FUNCTION_TABLE_ENTRY(glUniformMatrix4fv);
235     FUNCTION_TABLE_ENTRY(glUseProgram);
236     FUNCTION_TABLE_ENTRY(glValidateProgram);
237     FUNCTION_TABLE_ENTRY(glVertexAttrib1f);
238     FUNCTION_TABLE_ENTRY(glVertexAttrib1fv);
239     FUNCTION_TABLE_ENTRY(glVertexAttrib2f);
240     FUNCTION_TABLE_ENTRY(glVertexAttrib2fv);
241     FUNCTION_TABLE_ENTRY(glVertexAttrib3f);
242     FUNCTION_TABLE_ENTRY(glVertexAttrib3fv);
243     FUNCTION_TABLE_ENTRY(glVertexAttrib4f);
244     FUNCTION_TABLE_ENTRY(glVertexAttrib4fv);
245     FUNCTION_TABLE_ENTRY(glVertexAttribPointer);
246 } OpenGLFunctionTable;
247
248 // We disable the shims for OpenGLShims.cpp, so that we can set them.
249 #ifndef DISABLE_SHIMS
250 #define LOOKUP_GL_FUNCTION(Function) WebCore::openGLFunctionTable()->Function
251 #define glActiveTexture                        LOOKUP_GL_FUNCTION(glActiveTexture)
252 #define glAttachShader                         LOOKUP_GL_FUNCTION(glAttachShader)
253 #define glBindAttribLocation                   LOOKUP_GL_FUNCTION(glBindAttribLocation)
254 #define glBindBuffer                           LOOKUP_GL_FUNCTION(glBindBuffer)
255 #define glBindFramebufferEXT                   glBindFramebuffer
256 #define glBindFramebuffer                      LOOKUP_GL_FUNCTION(glBindFramebuffer)
257 #define glBindRenderbufferEXT                  glBindRenderbuffer
258 #define glBindRenderbuffer                     LOOKUP_GL_FUNCTION(glBindRenderbuffer)
259 #define glBindVertexArray                      LOOKUP_GL_FUNCTION(glBindVertexArray)
260 #define glBlendColor                           LOOKUP_GL_FUNCTION(glBlendColor)
261 #define glBlendEquation                        LOOKUP_GL_FUNCTION(glBlendEquation)
262 #define glBlendEquationSeparate                LOOKUP_GL_FUNCTION(glBlendEquationSeparate)
263 #define glBlendFuncSeparate                    LOOKUP_GL_FUNCTION(glBlendFuncSeparate)
264 #define glBlitFramebufferEXT                   glBlitFramebuffer
265 #define glBlitFramebuffer                      LOOKUP_GL_FUNCTION(glBlitFramebuffer)
266 #define glBufferData                           LOOKUP_GL_FUNCTION(glBufferData)
267 #define glBufferSubData                        LOOKUP_GL_FUNCTION(glBufferSubData)
268 #define glCheckFramebufferStatusEXT            glCheckFramebufferStatus
269 #define glCheckFramebufferStatus               LOOKUP_GL_FUNCTION(glCheckFramebufferStatus)
270 #define glCompileShader                        LOOKUP_GL_FUNCTION(glCompileShader)
271 #define glCreateProgram                        LOOKUP_GL_FUNCTION(glCreateProgram)
272 #define glCreateShader                         LOOKUP_GL_FUNCTION(glCreateShader)
273 #define glDeleteBuffers                        LOOKUP_GL_FUNCTION(glDeleteBuffers)
274 #define glDeleteFramebuffersEXT                glDeleteFramebuffers
275 #define glDeleteFramebuffers                   LOOKUP_GL_FUNCTION(glDeleteFramebuffers)
276 #define glDeleteProgram                        LOOKUP_GL_FUNCTION(glDeleteProgram)
277 #define glDeleteRenderbuffersEXT               glDeleteRenderbuffers
278 #define glDeleteRenderbuffers                  LOOKUP_GL_FUNCTION(glDeleteRenderbuffers)
279 #define glDeleteShader                         LOOKUP_GL_FUNCTION(glDeleteShader)
280 #define glDeleteVertexArrays                   LOOKUP_GL_FUNCTION(glDeleteVertexArrays)
281 #define glDetachShader                         LOOKUP_GL_FUNCTION(glDetachShader)
282 #define glDisableVertexAttribArray             LOOKUP_GL_FUNCTION(glDisableVertexAttribArray)
283 #define glEnableVertexAttribArray              LOOKUP_GL_FUNCTION(glEnableVertexAttribArray)
284 #define glFramebufferRenderbufferEXT           glFramebufferRenderbuffer
285 #define glFramebufferRenderbuffer              LOOKUP_GL_FUNCTION(glFramebufferRenderbuffer)
286 #define glFramebufferTexture2DEXT              glFramebufferTexture2D
287 #define glFramebufferTexture2D                 LOOKUP_GL_FUNCTION(glFramebufferTexture2D)
288 #define glGenBuffers                           LOOKUP_GL_FUNCTION(glGenBuffers)
289 #define glGenerateMipmapEXT                    glGenerateMipmap
290 #define glGenerateMipmap                       LOOKUP_GL_FUNCTION(glGenerateMipmap)
291 #define glGenFramebuffersEXT                   glGenFramebuffers
292 #define glGenFramebuffers                      LOOKUP_GL_FUNCTION(glGenFramebuffers)
293 #define glGenRenderbuffersEXT                  glGenRenderbuffers
294 #define glGenRenderbuffers                     LOOKUP_GL_FUNCTION(glGenRenderbuffers)
295 #define glGenVertexArrays                      LOOKUP_GL_FUNCTION(glGenVertexArrays)
296 #define glGetActiveAttrib                      LOOKUP_GL_FUNCTION(glGetActiveAttrib)
297 #define glGetActiveUniform                     LOOKUP_GL_FUNCTION(glGetActiveUniform)
298 #define glGetAttachedShaders                   LOOKUP_GL_FUNCTION(glGetAttachedShaders)
299 #define glGetAttribLocation                    LOOKUP_GL_FUNCTION(glGetAttribLocation)
300 #define glGetBufferParameterivEXT              glGetBufferParameteriv
301 #define glGetBufferParameteriv                 LOOKUP_GL_FUNCTION(glGetBufferParameteriv)
302 #define glGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
303 #define glGetFramebufferAttachmentParameteriv  LOOKUP_GL_FUNCTION(glGetFramebufferAttachmentParameteriv)
304 #define glGetProgramInfoLog                    LOOKUP_GL_FUNCTION(glGetProgramInfoLog)
305 #define glGetProgramiv                         LOOKUP_GL_FUNCTION(glGetProgramiv)
306 #define glGetRenderbufferParameterivEXT        glGetRenderbufferParameteriv
307 #define glGetRenderbufferParameteriv           LOOKUP_GL_FUNCTION(glGetRenderbufferParameteriv)
308 #define glGetShaderInfoLog                     LOOKUP_GL_FUNCTION(glGetShaderInfoLog)
309 #define glGetShaderiv                          LOOKUP_GL_FUNCTION(glGetShaderiv)
310 #define glGetShaderSource                      LOOKUP_GL_FUNCTION(glGetShaderSource)
311 #define glGetUniformfv                         LOOKUP_GL_FUNCTION(glGetUniformfv)
312 #define glGetUniformiv                         LOOKUP_GL_FUNCTION(glGetUniformiv)
313 #define glGetUniformLocation                   LOOKUP_GL_FUNCTION(glGetUniformLocation)
314 #define glGetVertexAttribfv                    LOOKUP_GL_FUNCTION(glGetVertexAttribfv)
315 #define glGetVertexAttribiv                    LOOKUP_GL_FUNCTION(glGetVertexAttribiv)
316 #define glGetVertexAttribPointerv              LOOKUP_GL_FUNCTION(glGetVertexAttribPointerv)
317 #define glIsBuffer                             LOOKUP_GL_FUNCTION(glIsBuffer)
318 #define glIsFramebufferEXT                     glIsFramebuffer
319 #define glIsFramebuffer                        LOOKUP_GL_FUNCTION(glIsFramebuffer)
320 #define glIsProgram                            LOOKUP_GL_FUNCTION(glIsProgram)
321 #define glIsRenderbufferEXT                    glIsRenderbuffer
322 #define glIsRenderbuffer                       LOOKUP_GL_FUNCTION(glIsRenderbuffer)
323 #define glIsShader                             LOOKUP_GL_FUNCTION(glIsShader)
324 #define glIsVertexArray                        LOOKUP_GL_FUNCTION(glIsVertexArray)
325 #define glLinkProgram                          LOOKUP_GL_FUNCTION(glLinkProgram)
326 #define glRenderbufferStorageEXT               glRenderbufferStorage
327 #define glRenderbufferStorage                  LOOKUP_GL_FUNCTION(glRenderbufferStorage)
328 #define glRenderbufferStorageMultisampleEXT    glRenderbufferStorageMultisample
329 #define glRenderbufferStorageMultisample       LOOKUP_GL_FUNCTION(glRenderbufferStorageMultisample)
330 #define glSampleCoverage                       LOOKUP_GL_FUNCTION(glSampleCoverage)
331 #define glShaderSource                         LOOKUP_GL_FUNCTION(glShaderSource)
332 #define glStencilFuncSeparate                  LOOKUP_GL_FUNCTION(glStencilFuncSeparate)
333 #define glStencilMaskSeparate                  LOOKUP_GL_FUNCTION(glStencilMaskSeparate)
334 #define glStencilOpSeparate                    LOOKUP_GL_FUNCTION(glStencilOpSeparate)
335 #define glUniform1f                            LOOKUP_GL_FUNCTION(glUniform1f)
336 #define glUniform1fv                           LOOKUP_GL_FUNCTION(glUniform1fv)
337 #define glUniform1i                            LOOKUP_GL_FUNCTION(glUniform1i)
338 #define glUniform1iv                           LOOKUP_GL_FUNCTION(glUniform1iv)
339 #define glUniform2f                            LOOKUP_GL_FUNCTION(glUniform2f)
340 #define glUniform2fv                           LOOKUP_GL_FUNCTION(glUniform2fv)
341 #define glUniform2i                            LOOKUP_GL_FUNCTION(glUniform2i)
342 #define glUniform2iv                           LOOKUP_GL_FUNCTION(glUniform2iv)
343 #define glUniform3f                            LOOKUP_GL_FUNCTION(glUniform3f)
344 #define glUniform3fv                           LOOKUP_GL_FUNCTION(glUniform3fv)
345 #define glUniform3i                            LOOKUP_GL_FUNCTION(glUniform3i)
346 #define glUniform3iv                           LOOKUP_GL_FUNCTION(glUniform3iv)
347 #define glUniform4f                            LOOKUP_GL_FUNCTION(glUniform4f)
348 #define glUniform4fv                           LOOKUP_GL_FUNCTION(glUniform4fv)
349 #define glUniform4i                            LOOKUP_GL_FUNCTION(glUniform4i)
350 #define glUniform4iv                           LOOKUP_GL_FUNCTION(glUniform4iv)
351 #define glUniformMatrix2fv                     LOOKUP_GL_FUNCTION(glUniformMatrix2fv)
352 #define glUniformMatrix3fv                     LOOKUP_GL_FUNCTION(glUniformMatrix3fv)
353 #define glUniformMatrix4fv                     LOOKUP_GL_FUNCTION(glUniformMatrix4fv)
354 #define glUseProgram                           LOOKUP_GL_FUNCTION(glUseProgram)
355 #define glValidateProgram                      LOOKUP_GL_FUNCTION(glValidateProgram)
356 #define glVertexAttrib1f                       LOOKUP_GL_FUNCTION(glVertexAttrib1f)
357 #define glVertexAttrib1fv                      LOOKUP_GL_FUNCTION(glVertexAttrib1fv)
358 #define glVertexAttrib2f                       LOOKUP_GL_FUNCTION(glVertexAttrib2f)
359 #define glVertexAttrib2fv                      LOOKUP_GL_FUNCTION(glVertexAttrib2fv)
360 #define glVertexAttrib3f                       LOOKUP_GL_FUNCTION(glVertexAttrib3f)
361 #define glVertexAttrib3fv                      LOOKUP_GL_FUNCTION(glVertexAttrib3fv)
362 #define glVertexAttrib4f                       LOOKUP_GL_FUNCTION(glVertexAttrib4f)
363 #define glVertexAttrib4fv                      LOOKUP_GL_FUNCTION(glVertexAttrib4fv)
364 #define glVertexAttribPointer                  LOOKUP_GL_FUNCTION(glVertexAttribPointer)
365 #endif
366
367 #endif