1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtOpenGL module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QGL_EXTENSIONS_P_H
43 #define QGL_EXTENSIONS_P_H
49 // This file is not part of the Qt API. It exists for the convenience
50 // of the Qt OpenGL classes. This header file may change from
51 // version to version without notice, or even be removed.
56 // extension prototypes
59 # define APIENTRYP APIENTRY *
66 #include <QtCore/qglobal.h>
68 #ifndef GL_ARB_vertex_buffer_object
69 typedef ptrdiff_t GLintptrARB;
70 typedef ptrdiff_t GLsizeiptrARB;
73 #ifndef GL_VERSION_2_0
77 // ARB_vertex_buffer_object
78 typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
79 typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
80 typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
81 typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
82 typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
83 typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
84 typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *);
85 typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum);
86 typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum);
87 // We can call the buffer functions directly in OpenGL/ES 1.1 or higher,
88 // but all other platforms need to resolve the extensions.
89 #if defined(QT_OPENGL_ES)
90 #if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
91 #define QGL_RESOLVE_BUFFER_FUNCS 1
94 #define QGL_RESOLVE_BUFFER_FUNCS 1
97 // ARB_fragment_program
98 typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *);
99 typedef void (APIENTRY *_glBindProgramARB) (GLenum, GLuint);
100 typedef void (APIENTRY *_glDeleteProgramsARB) (GLsizei, const GLuint *);
101 typedef void (APIENTRY *_glGenProgramsARB) (GLsizei, GLuint *);
102 typedef void (APIENTRY *_glProgramLocalParameter4fvARB) (GLenum, GLuint, const GLfloat *);
105 typedef GLuint (APIENTRY *_glCreateShader) (GLenum);
106 typedef void (APIENTRY *_glShaderSource) (GLuint, GLsizei, const char **, const GLint *);
107 typedef void (APIENTRY *_glShaderBinary) (GLint, const GLuint*, GLenum, const void*, GLint);
108 typedef void (APIENTRY *_glCompileShader) (GLuint);
109 typedef void (APIENTRY *_glDeleteShader) (GLuint);
110 typedef GLboolean (APIENTRY *_glIsShader) (GLuint);
112 typedef GLuint (APIENTRY *_glCreateProgram) ();
113 typedef void (APIENTRY *_glAttachShader) (GLuint, GLuint);
114 typedef void (APIENTRY *_glDetachShader) (GLuint, GLuint);
115 typedef void (APIENTRY *_glLinkProgram) (GLuint);
116 typedef void (APIENTRY *_glUseProgram) (GLuint);
117 typedef void (APIENTRY *_glDeleteProgram) (GLuint);
118 typedef GLboolean (APIENTRY *_glIsProgram) (GLuint);
120 typedef void (APIENTRY *_glGetShaderInfoLog) (GLuint, GLsizei, GLsizei *, char *);
121 typedef void (APIENTRY *_glGetShaderiv) (GLuint, GLenum, GLint *);
122 typedef void (APIENTRY *_glGetShaderSource) (GLuint, GLsizei, GLsizei *, char *);
123 typedef void (APIENTRY *_glGetProgramiv) (GLuint, GLenum, GLint *);
124 typedef void (APIENTRY *_glGetProgramInfoLog) (GLuint, GLsizei, GLsizei *, char *);
126 typedef GLuint (APIENTRY *_glGetUniformLocation) (GLuint, const char*);
127 typedef void (APIENTRY *_glUniform4fv) (GLint, GLsizei, const GLfloat *);
128 typedef void (APIENTRY *_glUniform3fv) (GLint, GLsizei, const GLfloat *);
129 typedef void (APIENTRY *_glUniform2fv) (GLint, GLsizei, const GLfloat *);
130 typedef void (APIENTRY *_glUniform1fv) (GLint, GLsizei, const GLfloat *);
131 typedef void (APIENTRY *_glUniform1i) (GLint, GLint);
132 typedef void (APIENTRY *_glUniform1iv) (GLint, GLsizei, const GLint *);
133 typedef void (APIENTRY *_glUniformMatrix2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
134 typedef void (APIENTRY *_glUniformMatrix3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
135 typedef void (APIENTRY *_glUniformMatrix4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
136 typedef void (APIENTRY *_glUniformMatrix2x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
137 typedef void (APIENTRY *_glUniformMatrix2x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
138 typedef void (APIENTRY *_glUniformMatrix3x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
139 typedef void (APIENTRY *_glUniformMatrix3x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
140 typedef void (APIENTRY *_glUniformMatrix4x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
141 typedef void (APIENTRY *_glUniformMatrix4x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
143 typedef void (APIENTRY *_glBindAttribLocation) (GLuint, GLuint, const char *);
144 typedef GLint (APIENTRY *_glGetAttribLocation) (GLuint, const char *);
145 typedef void (APIENTRY *_glVertexAttrib1fv) (GLuint, const GLfloat *);
146 typedef void (APIENTRY *_glVertexAttrib2fv) (GLuint, const GLfloat *);
147 typedef void (APIENTRY *_glVertexAttrib3fv) (GLuint, const GLfloat *);
148 typedef void (APIENTRY *_glVertexAttrib4fv) (GLuint, const GLfloat *);
149 typedef void (APIENTRY *_glVertexAttribPointer) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
150 typedef void (APIENTRY *_glDisableVertexAttribArray) (GLuint);
151 typedef void (APIENTRY *_glEnableVertexAttribArray) (GLuint);
153 typedef void (APIENTRY *_glGetProgramBinaryOES) (GLuint, GLsizei, GLsizei *, GLenum *, void *);
154 typedef void (APIENTRY *_glProgramBinaryOES) (GLuint, GLenum, const void *, GLint);
157 typedef void (APIENTRY *_glMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
158 typedef void (APIENTRY *_glActiveStencilFaceEXT) (GLenum );
160 // Needed for GL2 engine:
161 typedef void (APIENTRY *_glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
162 typedef void (APIENTRY *_glActiveTexture) (GLenum);
163 typedef void (APIENTRY *_glBlendColor) (GLclampf, GLclampf, GLclampf, GLclampf);
166 // EXT_GL_framebuffer_object
167 typedef GLboolean (APIENTRY *_glIsRenderbuffer) (GLuint renderbuffer);
168 typedef void (APIENTRY *_glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
169 typedef void (APIENTRY *_glDeleteRenderbuffers) (GLsizei n, const GLuint *renderbuffers);
170 typedef void (APIENTRY *_glGenRenderbuffers) (GLsizei n, GLuint *renderbuffers);
171 typedef void (APIENTRY *_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
172 typedef void (APIENTRY *_glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint *params);
173 typedef GLboolean (APIENTRY *_glIsFramebuffer) (GLuint framebuffer);
174 typedef void (APIENTRY *_glBindFramebuffer) (GLenum target, GLuint framebuffer);
175 typedef void (APIENTRY *_glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers);
176 typedef void (APIENTRY *_glGenFramebuffers) (GLsizei n, GLuint *framebuffers);
177 typedef GLenum (APIENTRY *_glCheckFramebufferStatus) (GLenum target);
178 typedef void (APIENTRY *_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget,
179 GLuint texture, GLint level);
180 typedef void (APIENTRY *_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget,
181 GLuint renderbuffer);
182 typedef void (APIENTRY *_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname,
184 typedef void (APIENTRY *_glGenerateMipmap) (GLenum target);
186 // EXT_GL_framebuffer_blit
187 typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, int srcY1,
188 int dstX0, int dstY0, int dstX1, int dstY1,
189 GLbitfield mask, GLenum filter);
191 // EXT_GL_framebuffer_multisample
192 typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples,
193 GLenum internalformat, GLsizei width, GLsizei height);
195 // GL_EXT_geometry_shader4
196 typedef void (APIENTRY *_glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value);
197 typedef void (APIENTRY *_glFramebufferTextureEXT)(GLenum target, GLenum attachment,
198 GLuint texture, GLint level);
199 typedef void (APIENTRY *_glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment,
200 GLuint texture, GLint level, GLint layer);
201 typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment,
202 GLuint texture, GLint level, GLenum face);
204 // ARB_texture_compression
205 typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei,
206 GLsizei, GLint, GLsizei, const GLvoid *);
209 struct QGLExtensionFuncs
211 QGLExtensionFuncs() {
212 #if !defined(QT_OPENGL_ES_2)
213 qt_glProgramStringARB = 0;
214 qt_glBindProgramARB = 0;
215 qt_glDeleteProgramsARB = 0;
216 qt_glGenProgramsARB = 0;
217 qt_glProgramLocalParameter4fvARB = 0;
220 qt_glCreateShader = 0;
221 qt_glShaderSource = 0;
222 qt_glShaderBinary = 0;
223 qt_glCompileShader = 0;
224 qt_glDeleteShader = 0;
227 qt_glCreateProgram = 0;
228 qt_glAttachShader = 0;
229 qt_glDetachShader = 0;
230 qt_glLinkProgram = 0;
232 qt_glDeleteProgram = 0;
235 qt_glGetShaderInfoLog = 0;
236 qt_glGetShaderiv = 0;
237 qt_glGetShaderSource = 0;
238 qt_glGetProgramiv = 0;
239 qt_glGetProgramInfoLog = 0;
241 qt_glGetUniformLocation = 0;
248 qt_glUniformMatrix2fv = 0;
249 qt_glUniformMatrix3fv = 0;
250 qt_glUniformMatrix4fv = 0;
251 qt_glUniformMatrix2x3fv = 0;
252 qt_glUniformMatrix2x4fv = 0;
253 qt_glUniformMatrix3x2fv = 0;
254 qt_glUniformMatrix3x4fv = 0;
255 qt_glUniformMatrix4x2fv = 0;
256 qt_glUniformMatrix4x3fv = 0;
258 qt_glBindAttribLocation = 0;
259 qt_glGetAttribLocation = 0;
260 qt_glVertexAttrib1fv = 0;
261 qt_glVertexAttrib2fv = 0;
262 qt_glVertexAttrib3fv = 0;
263 qt_glVertexAttrib4fv = 0;
264 qt_glVertexAttribPointer = 0;
265 qt_glDisableVertexAttribArray = 0;
266 qt_glEnableVertexAttribArray = 0;
268 // Extras for GL2 engine:
269 qt_glActiveTexture = 0;
270 qt_glStencilOpSeparate = 0;
273 qt_glActiveStencilFaceEXT = 0;
274 qt_glMultiTexCoord4f = 0;
276 qt_glslResolved = false;
278 qt_glGetProgramBinaryOES = 0;
279 qt_glProgramBinaryOES = 0;
283 #if !defined(QT_OPENGL_ES_2)
284 qt_glIsRenderbuffer = 0;
285 qt_glBindRenderbuffer = 0;
286 qt_glDeleteRenderbuffers = 0;
287 qt_glGenRenderbuffers = 0;
288 qt_glRenderbufferStorage = 0;
289 qt_glGetRenderbufferParameteriv = 0;
290 qt_glIsFramebuffer = 0;
291 qt_glBindFramebuffer = 0;
292 qt_glDeleteFramebuffers = 0;
293 qt_glGenFramebuffers = 0;
294 qt_glCheckFramebufferStatus = 0;
295 qt_glFramebufferTexture2D = 0;
296 qt_glFramebufferRenderbuffer = 0;
297 qt_glGetFramebufferAttachmentParameteriv = 0;
298 qt_glGenerateMipmap = 0;
300 qt_glBlitFramebufferEXT = 0;
301 qt_glRenderbufferStorageMultisampleEXT = 0;
304 #if defined(QGL_RESOLVE_BUFFER_FUNCS)
306 qt_glDeleteBuffers = 0;
309 qt_glBufferSubData = 0;
310 qt_glGetBufferSubData = 0;
311 qt_glGetBufferParameteriv = 0;
313 qt_glMapBufferARB = 0;
314 qt_glUnmapBufferARB = 0;
316 qt_glProgramParameteriEXT = 0;
317 qt_glFramebufferTextureEXT = 0;
318 qt_glFramebufferTextureLayerEXT = 0;
319 qt_glFramebufferTextureFaceEXT = 0;
320 #if !defined(QT_OPENGL_ES)
321 // Texture compression
322 qt_glCompressedTexImage2DARB = 0;
327 #if !defined(QT_OPENGL_ES_2)
328 _glProgramStringARB qt_glProgramStringARB;
329 _glBindProgramARB qt_glBindProgramARB;
330 _glDeleteProgramsARB qt_glDeleteProgramsARB;
331 _glGenProgramsARB qt_glGenProgramsARB;
332 _glProgramLocalParameter4fvARB qt_glProgramLocalParameter4fvARB;
335 _glCreateShader qt_glCreateShader;
336 _glShaderSource qt_glShaderSource;
337 _glShaderBinary qt_glShaderBinary;
338 _glCompileShader qt_glCompileShader;
339 _glDeleteShader qt_glDeleteShader;
340 _glIsShader qt_glIsShader;
342 _glCreateProgram qt_glCreateProgram;
343 _glAttachShader qt_glAttachShader;
344 _glDetachShader qt_glDetachShader;
345 _glLinkProgram qt_glLinkProgram;
346 _glUseProgram qt_glUseProgram;
347 _glDeleteProgram qt_glDeleteProgram;
348 _glIsProgram qt_glIsProgram;
350 _glGetShaderInfoLog qt_glGetShaderInfoLog;
351 _glGetShaderiv qt_glGetShaderiv;
352 _glGetShaderSource qt_glGetShaderSource;
353 _glGetProgramiv qt_glGetProgramiv;
354 _glGetProgramInfoLog qt_glGetProgramInfoLog;
356 _glGetUniformLocation qt_glGetUniformLocation;
357 _glUniform4fv qt_glUniform4fv;
358 _glUniform3fv qt_glUniform3fv;
359 _glUniform2fv qt_glUniform2fv;
360 _glUniform1fv qt_glUniform1fv;
361 _glUniform1i qt_glUniform1i;
362 _glUniform1iv qt_glUniform1iv;
363 _glUniformMatrix2fv qt_glUniformMatrix2fv;
364 _glUniformMatrix3fv qt_glUniformMatrix3fv;
365 _glUniformMatrix4fv qt_glUniformMatrix4fv;
366 _glUniformMatrix2x3fv qt_glUniformMatrix2x3fv;
367 _glUniformMatrix2x4fv qt_glUniformMatrix2x4fv;
368 _glUniformMatrix3x2fv qt_glUniformMatrix3x2fv;
369 _glUniformMatrix3x4fv qt_glUniformMatrix3x4fv;
370 _glUniformMatrix4x2fv qt_glUniformMatrix4x2fv;
371 _glUniformMatrix4x3fv qt_glUniformMatrix4x3fv;
373 _glBindAttribLocation qt_glBindAttribLocation;
374 _glGetAttribLocation qt_glGetAttribLocation;
375 _glVertexAttrib1fv qt_glVertexAttrib1fv;
376 _glVertexAttrib2fv qt_glVertexAttrib2fv;
377 _glVertexAttrib3fv qt_glVertexAttrib3fv;
378 _glVertexAttrib4fv qt_glVertexAttrib4fv;
379 _glVertexAttribPointer qt_glVertexAttribPointer;
380 _glDisableVertexAttribArray qt_glDisableVertexAttribArray;
381 _glEnableVertexAttribArray qt_glEnableVertexAttribArray;
384 bool qt_glslResolved;
386 _glGetProgramBinaryOES qt_glGetProgramBinaryOES;
387 _glProgramBinaryOES qt_glProgramBinaryOES;
390 _glActiveStencilFaceEXT qt_glActiveStencilFaceEXT;
391 _glMultiTexCoord4f qt_glMultiTexCoord4f;
393 #if !defined(QT_OPENGL_ES_2)
394 // Extras needed for GL2 engine:
395 _glActiveTexture qt_glActiveTexture;
396 _glStencilOpSeparate qt_glStencilOpSeparate;
397 _glBlendColor qt_glBlendColor;
402 #if !defined(QT_OPENGL_ES_2)
403 _glIsRenderbuffer qt_glIsRenderbuffer;
404 _glBindRenderbuffer qt_glBindRenderbuffer;
405 _glDeleteRenderbuffers qt_glDeleteRenderbuffers;
406 _glGenRenderbuffers qt_glGenRenderbuffers;
407 _glRenderbufferStorage qt_glRenderbufferStorage;
408 _glGetRenderbufferParameteriv qt_glGetRenderbufferParameteriv;
409 _glIsFramebuffer qt_glIsFramebuffer;
410 _glBindFramebuffer qt_glBindFramebuffer;
411 _glDeleteFramebuffers qt_glDeleteFramebuffers;
412 _glGenFramebuffers qt_glGenFramebuffers;
413 _glCheckFramebufferStatus qt_glCheckFramebufferStatus;
414 _glFramebufferTexture2D qt_glFramebufferTexture2D;
415 _glFramebufferRenderbuffer qt_glFramebufferRenderbuffer;
416 _glGetFramebufferAttachmentParameteriv qt_glGetFramebufferAttachmentParameteriv;
417 _glGenerateMipmap qt_glGenerateMipmap;
419 _glBlitFramebufferEXT qt_glBlitFramebufferEXT;
420 _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT;
423 #if defined(QGL_RESOLVE_BUFFER_FUNCS)
424 _glBindBuffer qt_glBindBuffer;
425 _glDeleteBuffers qt_glDeleteBuffers;
426 _glGenBuffers qt_glGenBuffers;
427 _glBufferData qt_glBufferData;
428 _glBufferSubData qt_glBufferSubData;
429 _glGetBufferSubData qt_glGetBufferSubData;
430 _glGetBufferParameteriv qt_glGetBufferParameteriv;
432 _glMapBufferARB qt_glMapBufferARB;
433 _glUnmapBufferARB qt_glUnmapBufferARB;
435 // Geometry shaders...
436 _glProgramParameteriEXT qt_glProgramParameteriEXT;
437 _glFramebufferTextureEXT qt_glFramebufferTextureEXT;
438 _glFramebufferTextureLayerEXT qt_glFramebufferTextureLayerEXT;
439 _glFramebufferTextureFaceEXT qt_glFramebufferTextureFaceEXT;
440 #if !defined(QT_OPENGL_ES)
441 // Texture compression
442 _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB;
447 #if !defined(QT_OPENGL_ES_2)
448 #define glProgramStringARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB
449 #define glBindProgramARB QGLContextPrivate::extensionFuncs(ctx).qt_glBindProgramARB
450 #define glDeleteProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgramsARB
451 #define glGenProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glGenProgramsARB
452 #define glProgramLocalParameter4fvARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramLocalParameter4fvARB
454 #define glActiveStencilFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glActiveStencilFaceEXT
456 #define glMultiTexCoord4f QGLContextPrivate::extensionFuncs(ctx).qt_glMultiTexCoord4f
458 #define glActiveTexture QGLContextPrivate::extensionFuncs(ctx).qt_glActiveTexture
459 #endif // !defined(QT_OPENGL_ES_2)
463 #if !defined(QT_OPENGL_ES_2)
464 #define glIsRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsRenderbuffer
465 #define glBindRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindRenderbuffer
466 #define glDeleteRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteRenderbuffers
467 #define glGenRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenRenderbuffers
468 #define glRenderbufferStorage QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorage
469 #define glGetRenderbufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetRenderbufferParameteriv
470 #define glIsFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsFramebuffer
471 #define glBindFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindFramebuffer
472 #define glDeleteFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteFramebuffers
473 #define glGenFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenFramebuffers
474 #define glCheckFramebufferStatus QGLContextPrivate::extensionFuncs(ctx).qt_glCheckFramebufferStatus
475 #define glFramebufferTexture2D QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTexture2D
476 #define glFramebufferRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferRenderbuffer
477 #define glGetFramebufferAttachmentParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetFramebufferAttachmentParameteriv
478 #define glGenerateMipmap QGLContextPrivate::extensionFuncs(ctx).qt_glGenerateMipmap
479 #endif // QT_OPENGL_ES_2
480 #define glBlitFramebufferEXT QGLContextPrivate::extensionFuncs(ctx).qt_glBlitFramebufferEXT
481 #define glRenderbufferStorageMultisampleEXT QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorageMultisampleEXT
485 #if defined(QGL_RESOLVE_BUFFER_FUNCS)
486 #define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer
487 #define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers
488 #define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers
489 #define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData
490 #define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData
491 #define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData
492 #define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv
494 #define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB
495 #define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB
499 #if !defined(QT_OPENGL_ES_2)
501 #define glCreateShader QGLContextPrivate::extensionFuncs(ctx).qt_glCreateShader
502 #define glShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glShaderSource
503 #define glShaderBinary QGLContextPrivate::extensionFuncs(ctx).qt_glShaderBinary
504 #define glCompileShader QGLContextPrivate::extensionFuncs(ctx).qt_glCompileShader
505 #define glDeleteShader QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader
506 #define glIsShader QGLContextPrivate::extensionFuncs(ctx).qt_glIsShader
508 #define glCreateProgram QGLContextPrivate::extensionFuncs(ctx).qt_glCreateProgram
509 #define glAttachShader QGLContextPrivate::extensionFuncs(ctx).qt_glAttachShader
510 #define glDetachShader QGLContextPrivate::extensionFuncs(ctx).qt_glDetachShader
511 #define glLinkProgram QGLContextPrivate::extensionFuncs(ctx).qt_glLinkProgram
512 #define glUseProgram QGLContextPrivate::extensionFuncs(ctx).qt_glUseProgram
513 #define glDeleteProgram QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram
514 #define glIsProgram QGLContextPrivate::extensionFuncs(ctx).qt_glIsProgram
516 #define glGetShaderInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderInfoLog
517 #define glGetShaderiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderiv
518 #define glGetShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderSource
519 #define glGetProgramiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramiv
520 #define glGetProgramInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramInfoLog
522 #define glGetUniformLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetUniformLocation
523 #define glUniform4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform4fv
524 #define glUniform3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform3fv
525 #define glUniform2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform2fv
526 #define glUniform1fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1fv
527 #define glUniform1i QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1i
528 #define glUniform1iv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1iv
529 #define glUniformMatrix2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2fv
530 #define glUniformMatrix3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3fv
531 #define glUniformMatrix4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4fv
532 #define glUniformMatrix2x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x3fv
533 #define glUniformMatrix2x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x4fv
534 #define glUniformMatrix3x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x2fv
535 #define glUniformMatrix3x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x4fv
536 #define glUniformMatrix4x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x2fv
537 #define glUniformMatrix4x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x3fv
539 #define glBindAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glBindAttribLocation
540 #define glGetAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetAttribLocation
541 #define glVertexAttrib1fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib1fv
542 #define glVertexAttrib2fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib2fv
543 #define glVertexAttrib3fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib3fv
544 #define glVertexAttrib4fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib4fv
545 #define glVertexAttribPointer QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttribPointer
546 #define glDisableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glDisableVertexAttribArray
547 #define glEnableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glEnableVertexAttribArray
549 #else // QT_OPENGL_ES_2
551 #define glGetProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramBinaryOES
552 #define glProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glProgramBinaryOES
554 #endif // QT_OPENGL_ES_2
557 #if !defined(QT_OPENGL_ES_2)
558 #define glStencilOpSeparate QGLContextPrivate::extensionFuncs(ctx).qt_glStencilOpSeparate
559 #define glBlendColor QGLContextPrivate::extensionFuncs(ctx).qt_glBlendColor
562 #if defined(QT_OPENGL_ES_2)
563 #define glClearDepth glClearDepthf
566 #define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT
567 #define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT
568 #define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT
569 #define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT
571 #if !defined(QT_OPENGL_ES)
572 #define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB
575 extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx);
576 bool qt_resolve_buffer_extensions(QGLContext *ctx);
578 bool qt_resolve_version_1_3_functions(QGLContext *ctx);
579 bool qt_resolve_version_2_0_functions(QGLContext *ctx);
580 bool qt_resolve_stencil_face_extension(QGLContext *ctx);
581 bool qt_resolve_frag_program_extensions(QGLContext *ctx);
583 bool qt_resolve_glsl_extensions(QGLContext *ctx);
587 #endif // QGL_EXTENSIONS_P_H