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 #include "qglfunctions.h"
44 #include "QtGui/private/qopenglcontext_p.h"
50 \brief The QGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
55 OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
56 common across many desktop and embedded OpenGL implementations.
57 However, it can be difficult to use the functions from that subset
58 because they need to be resolved manually on desktop systems.
60 QGLFunctions provides a guaranteed API that is available on all
61 OpenGL systems and takes care of function resolution on systems
62 that need it. The recommended way to use QGLFunctions is by
66 class MyGLWidget : public QGLWidget, protected QGLFunctions
70 MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
77 void MyGLWidget::initializeGL()
79 initializeGLFunctions();
83 The \c{paintGL()} function can then use any of the OpenGL/ES 2.0
84 functions without explicit resolution, such as glActiveTexture()
85 in the following example:
88 void MyGLWidget::paintGL()
90 glActiveTexture(GL_TEXTURE1);
91 glBindTexture(GL_TEXTURE_2D, textureId);
96 QGLFunctions can also be used directly for ad-hoc invocation
97 of OpenGL/ES 2.0 functions on all platforms:
100 QGLFunctions glFuncs(QGLContext::currentContext());
101 glFuncs.glActiveTexture(GL_TEXTURE1);
104 QGLFunctions provides wrappers for all OpenGL/ES 2.0 functions,
105 except those like \c{glDrawArrays()}, \c{glViewport()}, and
106 \c{glBindTexture()} that don't have portability issues.
108 Including the header for QGLFunctions will also define all of
109 the OpenGL/ES 2.0 macro constants that are not already defined by
110 the system's OpenGL headers, such as \c{GL_TEXTURE1} above.
112 The hasOpenGLFeature() and openGLFeatures() functions can be used
113 to determine if the OpenGL implementation has a major OpenGL/ES 2.0
114 feature. For example, the following checks if non power of two
115 textures are available:
118 QGLFunctions funcs(QGLContext::currentContext());
119 bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
122 \note This class has been deprecated in favor of QOpenGLFunctions.
126 \enum QGLFunctions::OpenGLFeature
127 This enum defines OpenGL/ES 2.0 features that may be optional
130 \value Multitexture glActiveTexture() function is available.
131 \value Shaders Shader functions are available.
132 \value Buffers Vertex and index buffer functions are available.
133 \value Framebuffers Framebuffer object functions are available.
134 \value BlendColor glBlendColor() is available.
135 \value BlendEquation glBlendEquation() is available.
136 \value BlendEquationSeparate glBlendEquationSeparate() is available.
137 \value BlendFuncSeparate glBlendFuncSeparate() is available.
138 \value BlendSubtract Blend subtract mode is available.
139 \value CompressedTextures Compressed texture functions are available.
140 \value Multisample glSampleCoverage() function is available.
141 \value StencilSeparate Separate stencil functions are available.
142 \value NPOTTextures Non power of two textures are available.
145 // Hidden private fields for additional extension data.
146 struct QGLFunctionsPrivateEx : public QGLFunctionsPrivate, public QOpenGLSharedResource
148 QGLFunctionsPrivateEx(QOpenGLContext *context)
149 : QGLFunctionsPrivate(QGLContext::fromOpenGLContext(context))
150 , QOpenGLSharedResource(context->shareGroup())
153 void invalidateResource()
158 void freeResource(QOpenGLContext *)
160 // no gl resources to free
166 Q_GLOBAL_STATIC(QOpenGLMultiGroupSharedResource, qt_gl_functions_resource)
168 static QGLFunctionsPrivateEx *qt_gl_functions(const QGLContext *context = 0)
171 context = QGLContext::currentContext();
173 QGLFunctionsPrivateEx *funcs =
174 reinterpret_cast<QGLFunctionsPrivateEx *>
175 (qt_gl_functions_resource()->value<QGLFunctionsPrivateEx>(context->contextHandle()));
180 Constructs a default function resolver. The resolver cannot
181 be used until initializeGLFunctions() is called to specify
184 \sa initializeGLFunctions()
186 QGLFunctions::QGLFunctions()
192 Constructs a function resolver for \a context. If \a context
193 is null, then the resolver will be created for the current QGLContext.
195 An object constructed in this way can only be used with \a context
196 and other contexts that share with it. Use initializeGLFunctions()
197 to change the object's context association.
199 \sa initializeGLFunctions()
201 QGLFunctions::QGLFunctions(const QGLContext *context)
202 : d_ptr(qt_gl_functions(context))
207 \fn QGLFunctions::~QGLFunctions()
209 Destroys this function resolver.
212 static int qt_gl_resolve_features()
214 #if defined(QT_OPENGL_ES_2)
215 int features = QGLFunctions::Multitexture |
216 QGLFunctions::Shaders |
217 QGLFunctions::Buffers |
218 QGLFunctions::Framebuffers |
219 QGLFunctions::BlendColor |
220 QGLFunctions::BlendEquation |
221 QGLFunctions::BlendEquationSeparate |
222 QGLFunctions::BlendFuncSeparate |
223 QGLFunctions::BlendSubtract |
224 QGLFunctions::CompressedTextures |
225 QGLFunctions::Multisample |
226 QGLFunctions::StencilSeparate;
227 QGLExtensionMatcher extensions;
228 if (extensions.match("GL_OES_texture_npot"))
229 features |= QGLFunctions::NPOTTextures;
230 if (extensions.match("GL_IMG_texture_npot"))
231 features |= QGLFunctions::NPOTTextures;
233 #elif defined(QT_OPENGL_ES)
234 int features = QGLFunctions::Multitexture |
235 QGLFunctions::Buffers |
236 QGLFunctions::CompressedTextures |
237 QGLFunctions::Multisample;
238 QGLExtensionMatcher extensions;
239 if (extensions.match("GL_OES_framebuffer_object"))
240 features |= QGLFunctions::Framebuffers;
241 if (extensions.match("GL_OES_blend_equation_separate"))
242 features |= QGLFunctions::BlendEquationSeparate;
243 if (extensions.match("GL_OES_blend_func_separate"))
244 features |= QGLFunctions::BlendFuncSeparate;
245 if (extensions.match("GL_OES_blend_subtract"))
246 features |= QGLFunctions::BlendSubtract;
247 if (extensions.match("GL_OES_texture_npot"))
248 features |= QGLFunctions::NPOTTextures;
249 if (extensions.match("GL_IMG_texture_npot"))
250 features |= QGLFunctions::NPOTTextures;
254 QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
255 QGLExtensionMatcher extensions;
257 // Recognize features by extension name.
258 if (extensions.match("GL_ARB_multitexture"))
259 features |= QGLFunctions::Multitexture;
260 if (extensions.match("GL_ARB_shader_objects"))
261 features |= QGLFunctions::Shaders;
262 if (extensions.match("GL_EXT_framebuffer_object") ||
263 extensions.match("GL_ARB_framebuffer_object"))
264 features |= QGLFunctions::Framebuffers;
265 if (extensions.match("GL_EXT_blend_color"))
266 features |= QGLFunctions::BlendColor;
267 if (extensions.match("GL_EXT_blend_equation_separate"))
268 features |= QGLFunctions::BlendEquationSeparate;
269 if (extensions.match("GL_EXT_blend_func_separate"))
270 features |= QGLFunctions::BlendFuncSeparate;
271 if (extensions.match("GL_EXT_blend_subtract"))
272 features |= QGLFunctions::BlendSubtract;
273 if (extensions.match("GL_ARB_texture_compression"))
274 features |= QGLFunctions::CompressedTextures;
275 if (extensions.match("GL_ARB_multisample"))
276 features |= QGLFunctions::Multisample;
277 if (extensions.match("GL_ARB_texture_non_power_of_two"))
278 features |= QGLFunctions::NPOTTextures;
280 // Recognize features by minimum OpenGL version.
281 if (versions & QGLFormat::OpenGL_Version_1_2) {
282 features |= QGLFunctions::BlendColor |
283 QGLFunctions::BlendEquation;
285 if (versions & QGLFormat::OpenGL_Version_1_3) {
286 features |= QGLFunctions::Multitexture |
287 QGLFunctions::CompressedTextures |
288 QGLFunctions::Multisample;
290 if (versions & QGLFormat::OpenGL_Version_1_4)
291 features |= QGLFunctions::BlendFuncSeparate;
292 if (versions & QGLFormat::OpenGL_Version_1_5)
293 features |= QGLFunctions::Buffers;
294 if (versions & QGLFormat::OpenGL_Version_2_0) {
295 features |= QGLFunctions::Shaders |
296 QGLFunctions::StencilSeparate |
297 QGLFunctions::BlendEquationSeparate |
298 QGLFunctions::NPOTTextures;
305 Returns the set of features that are present on this system's
306 OpenGL implementation.
308 It is assumed that the QGLContext associated with this function
311 \sa hasOpenGLFeature()
313 QGLFunctions::OpenGLFeatures QGLFunctions::openGLFeatures() const
315 QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
318 if (d->m_features == -1)
319 d->m_features = qt_gl_resolve_features();
320 return QGLFunctions::OpenGLFeatures(d->m_features);
324 Returns true if \a feature is present on this system's OpenGL
325 implementation; false otherwise.
327 It is assumed that the QGLContext associated with this function
332 bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const
334 QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
337 if (d->m_features == -1)
338 d->m_features = qt_gl_resolve_features();
339 return (d->m_features & int(feature)) != 0;
343 Initializes GL function resolution for \a context. If \a context
344 is null, then the current QGLContext will be used.
346 After calling this function, the QGLFunctions object can only be
347 used with \a context and other contexts that share with it.
348 Call initializeGLFunctions() again to change the object's context
351 void QGLFunctions::initializeGLFunctions(const QGLContext *context)
353 d_ptr = qt_gl_functions(context);
357 \fn void QGLFunctions::glActiveTexture(GLenum texture)
359 Convenience function that calls glActiveTexture(\a texture).
361 For more information, see the OpenGL/ES 2.0 documentation for
362 \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
366 \fn void QGLFunctions::glAttachShader(GLuint program, GLuint shader)
368 Convenience function that calls glAttachShader(\a program, \a shader).
370 For more information, see the OpenGL/ES 2.0 documentation for
371 \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
373 This convenience function will do nothing on OpenGL/ES 1.x systems.
377 \fn void QGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
379 Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
381 For more information, see the OpenGL/ES 2.0 documentation for
382 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
384 This convenience function will do nothing on OpenGL/ES 1.x systems.
388 \fn void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
390 Convenience function that calls glBindBuffer(\a target, \a buffer).
392 For more information, see the OpenGL/ES 2.0 documentation for
393 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
397 \fn void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
399 Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
401 Note that Qt will translate a \a framebuffer argument of 0 to the currently
402 bound QOpenGLContext's defaultFramebufferObject().
404 For more information, see the OpenGL/ES 2.0 documentation for
405 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
409 \fn void QGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
411 Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
413 For more information, see the OpenGL/ES 2.0 documentation for
414 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
418 \fn void QGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
420 Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
422 For more information, see the OpenGL/ES 2.0 documentation for
423 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
427 \fn void QGLFunctions::glBlendEquation(GLenum mode)
429 Convenience function that calls glBlendEquation(\a mode).
431 For more information, see the OpenGL/ES 2.0 documentation for
432 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
436 \fn void QGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
438 Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
440 For more information, see the OpenGL/ES 2.0 documentation for
441 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
445 \fn void QGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
447 Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
449 For more information, see the OpenGL/ES 2.0 documentation for
450 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
454 \fn void QGLFunctions::glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
456 Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
458 For more information, see the OpenGL/ES 2.0 documentation for
459 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
463 \fn void QGLFunctions::glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
465 Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
467 For more information, see the OpenGL/ES 2.0 documentation for
468 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
472 \fn GLenum QGLFunctions::glCheckFramebufferStatus(GLenum target)
474 Convenience function that calls glCheckFramebufferStatus(\a target).
476 For more information, see the OpenGL/ES 2.0 documentation for
477 \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
481 \fn void QGLFunctions::glClearDepthf(GLclampf depth)
483 Convenience function that calls glClearDepth(\a depth) on
484 desktop OpenGL systems and glClearDepthf(\a depth) on
485 embedded OpenGL/ES systems.
487 For more information, see the OpenGL/ES 2.0 documentation for
488 \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
492 \fn void QGLFunctions::glCompileShader(GLuint shader)
494 Convenience function that calls glCompileShader(\a shader).
496 For more information, see the OpenGL/ES 2.0 documentation for
497 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
499 This convenience function will do nothing on OpenGL/ES 1.x systems.
503 \fn void QGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
505 Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
507 For more information, see the OpenGL/ES 2.0 documentation for
508 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
512 \fn void QGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
514 Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
516 For more information, see the OpenGL/ES 2.0 documentation for
517 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
521 \fn GLuint QGLFunctions::glCreateProgram()
523 Convenience function that calls glCreateProgram().
525 For more information, see the OpenGL/ES 2.0 documentation for
526 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
528 This convenience function will do nothing on OpenGL/ES 1.x systems.
532 \fn GLuint QGLFunctions::glCreateShader(GLenum type)
534 Convenience function that calls glCreateShader(\a type).
536 For more information, see the OpenGL/ES 2.0 documentation for
537 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
539 This convenience function will do nothing on OpenGL/ES 1.x systems.
543 \fn void QGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
545 Convenience function that calls glDeleteBuffers(\a n, \a buffers).
547 For more information, see the OpenGL/ES 2.0 documentation for
548 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
552 \fn void QGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
554 Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
556 For more information, see the OpenGL/ES 2.0 documentation for
557 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
561 \fn void QGLFunctions::glDeleteProgram(GLuint program)
563 Convenience function that calls glDeleteProgram(\a program).
565 For more information, see the OpenGL/ES 2.0 documentation for
566 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
568 This convenience function will do nothing on OpenGL/ES 1.x systems.
572 \fn void QGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
574 Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
576 For more information, see the OpenGL/ES 2.0 documentation for
577 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
581 \fn void QGLFunctions::glDeleteShader(GLuint shader)
583 Convenience function that calls glDeleteShader(\a shader).
585 For more information, see the OpenGL/ES 2.0 documentation for
586 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
588 This convenience function will do nothing on OpenGL/ES 1.x systems.
592 \fn void QGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
594 Convenience function that calls glDepthRange(\a zNear, \a zFar) on
595 desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
596 embedded OpenGL/ES systems.
598 For more information, see the OpenGL/ES 2.0 documentation for
599 \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
603 \fn void QGLFunctions::glDetachShader(GLuint program, GLuint shader)
605 Convenience function that calls glDetachShader(\a program, \a shader).
607 For more information, see the OpenGL/ES 2.0 documentation for
608 \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
610 This convenience function will do nothing on OpenGL/ES 1.x systems.
614 \fn void QGLFunctions::glDisableVertexAttribArray(GLuint index)
616 Convenience function that calls glDisableVertexAttribArray(\a index).
618 For more information, see the OpenGL/ES 2.0 documentation for
619 \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
621 This convenience function will do nothing on OpenGL/ES 1.x systems.
625 \fn void QGLFunctions::glEnableVertexAttribArray(GLuint index)
627 Convenience function that calls glEnableVertexAttribArray(\a index).
629 For more information, see the OpenGL/ES 2.0 documentation for
630 \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
632 This convenience function will do nothing on OpenGL/ES 1.x systems.
636 \fn void QGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
638 Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
640 For more information, see the OpenGL/ES 2.0 documentation for
641 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
645 \fn void QGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
647 Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
649 For more information, see the OpenGL/ES 2.0 documentation for
650 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
654 \fn void QGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
656 Convenience function that calls glGenBuffers(\a n, \a buffers).
658 For more information, see the OpenGL/ES 2.0 documentation for
659 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
663 \fn void QGLFunctions::glGenerateMipmap(GLenum target)
665 Convenience function that calls glGenerateMipmap(\a target).
667 For more information, see the OpenGL/ES 2.0 documentation for
668 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
672 \fn void QGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
674 Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
676 For more information, see the OpenGL/ES 2.0 documentation for
677 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
681 \fn void QGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
683 Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
685 For more information, see the OpenGL/ES 2.0 documentation for
686 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
690 \fn void QGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
692 Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
694 For more information, see the OpenGL/ES 2.0 documentation for
695 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
697 This convenience function will do nothing on OpenGL/ES 1.x systems.
701 \fn void QGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
703 Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
705 For more information, see the OpenGL/ES 2.0 documentation for
706 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
708 This convenience function will do nothing on OpenGL/ES 1.x systems.
712 \fn void QGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
714 Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
716 For more information, see the OpenGL/ES 2.0 documentation for
717 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
719 This convenience function will do nothing on OpenGL/ES 1.x systems.
723 \fn int QGLFunctions::glGetAttribLocation(GLuint program, const char* name)
725 Convenience function that calls glGetAttribLocation(\a program, \a name).
727 For more information, see the OpenGL/ES 2.0 documentation for
728 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
730 This convenience function will do nothing on OpenGL/ES 1.x systems.
734 \fn void QGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
736 Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
738 For more information, see the OpenGL/ES 2.0 documentation for
739 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
743 \fn void QGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
745 Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
747 For more information, see the OpenGL/ES 2.0 documentation for
748 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
752 \fn void QGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
754 Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
756 For more information, see the OpenGL/ES 2.0 documentation for
757 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
759 This convenience function will do nothing on OpenGL/ES 1.x systems.
763 \fn void QGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
765 Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
767 For more information, see the OpenGL/ES 2.0 documentation for
768 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
770 This convenience function will do nothing on OpenGL/ES 1.x systems.
774 \fn void QGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
776 Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
778 For more information, see the OpenGL/ES 2.0 documentation for
779 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
783 \fn void QGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
785 Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
787 For more information, see the OpenGL/ES 2.0 documentation for
788 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
790 This convenience function will do nothing on OpenGL/ES 1.x systems.
794 \fn void QGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
796 Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
798 For more information, see the OpenGL/ES 2.0 documentation for
799 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
801 This convenience function will do nothing on OpenGL/ES 1.x systems.
805 \fn void QGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
807 Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
809 For more information, see the OpenGL/ES 2.0 documentation for
810 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
812 This convenience function will do nothing on OpenGL/ES 1.x systems.
816 \fn void QGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
818 Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
820 For more information, see the OpenGL/ES 2.0 documentation for
821 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
823 This convenience function will do nothing on OpenGL/ES 1.x systems.
827 \fn void QGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
829 Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
831 For more information, see the OpenGL/ES 2.0 documentation for
832 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
834 This convenience function will do nothing on OpenGL/ES 1.x systems.
838 \fn void QGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
840 Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
842 For more information, see the OpenGL/ES 2.0 documentation for
843 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
845 This convenience function will do nothing on OpenGL/ES 1.x systems.
849 \fn int QGLFunctions::glGetUniformLocation(GLuint program, const char* name)
851 Convenience function that calls glGetUniformLocation(\a program, \a name).
853 For more information, see the OpenGL/ES 2.0 documentation for
854 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
856 This convenience function will do nothing on OpenGL/ES 1.x systems.
860 \fn void QGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
862 Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
864 For more information, see the OpenGL/ES 2.0 documentation for
865 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
867 This convenience function will do nothing on OpenGL/ES 1.x systems.
871 \fn void QGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
873 Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
875 For more information, see the OpenGL/ES 2.0 documentation for
876 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
878 This convenience function will do nothing on OpenGL/ES 1.x systems.
882 \fn void QGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
884 Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
886 For more information, see the OpenGL/ES 2.0 documentation for
887 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
889 This convenience function will do nothing on OpenGL/ES 1.x systems.
893 \fn GLboolean QGLFunctions::glIsBuffer(GLuint buffer)
895 Convenience function that calls glIsBuffer(\a buffer).
897 For more information, see the OpenGL/ES 2.0 documentation for
898 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
902 \fn GLboolean QGLFunctions::glIsFramebuffer(GLuint framebuffer)
904 Convenience function that calls glIsFramebuffer(\a framebuffer).
906 For more information, see the OpenGL/ES 2.0 documentation for
907 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
911 \fn GLboolean QGLFunctions::glIsProgram(GLuint program)
913 Convenience function that calls glIsProgram(\a program).
915 For more information, see the OpenGL/ES 2.0 documentation for
916 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
918 This convenience function will do nothing on OpenGL/ES 1.x systems.
922 \fn GLboolean QGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
924 Convenience function that calls glIsRenderbuffer(\a renderbuffer).
926 For more information, see the OpenGL/ES 2.0 documentation for
927 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
931 \fn GLboolean QGLFunctions::glIsShader(GLuint shader)
933 Convenience function that calls glIsShader(\a shader).
935 For more information, see the OpenGL/ES 2.0 documentation for
936 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
938 This convenience function will do nothing on OpenGL/ES 1.x systems.
942 \fn void QGLFunctions::glLinkProgram(GLuint program)
944 Convenience function that calls glLinkProgram(\a program).
946 For more information, see the OpenGL/ES 2.0 documentation for
947 \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
949 This convenience function will do nothing on OpenGL/ES 1.x systems.
953 \fn void QGLFunctions::glReleaseShaderCompiler()
955 Convenience function that calls glReleaseShaderCompiler().
957 For more information, see the OpenGL/ES 2.0 documentation for
958 \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
960 This convenience function will do nothing on OpenGL/ES 1.x systems.
964 \fn void QGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
966 Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
968 For more information, see the OpenGL/ES 2.0 documentation for
969 \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
973 \fn void QGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
975 Convenience function that calls glSampleCoverage(\a value, \a invert).
977 For more information, see the OpenGL/ES 2.0 documentation for
978 \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
982 \fn void QGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
984 Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
986 For more information, see the OpenGL/ES 2.0 documentation for
987 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
989 This convenience function will do nothing on OpenGL/ES 1.x systems.
993 \fn void QGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
995 Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
997 For more information, see the OpenGL/ES 2.0 documentation for
998 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
1000 This convenience function will do nothing on OpenGL/ES 1.x systems.
1004 \fn void QGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1006 Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1008 For more information, see the OpenGL/ES 2.0 documentation for
1009 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1013 \fn void QGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1015 Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1017 For more information, see the OpenGL/ES 2.0 documentation for
1018 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1022 \fn void QGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1024 Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1026 For more information, see the OpenGL/ES 2.0 documentation for
1027 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1031 \fn void QGLFunctions::glUniform1f(GLint location, GLfloat x)
1033 Convenience function that calls glUniform1f(\a location, \a x).
1035 For more information, see the OpenGL/ES 2.0 documentation for
1036 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1038 This convenience function will do nothing on OpenGL/ES 1.x systems.
1042 \fn void QGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1044 Convenience function that calls glUniform1fv(\a location, \a count, \a v).
1046 For more information, see the OpenGL/ES 2.0 documentation for
1047 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
1049 This convenience function will do nothing on OpenGL/ES 1.x systems.
1053 \fn void QGLFunctions::glUniform1i(GLint location, GLint x)
1055 Convenience function that calls glUniform1i(\a location, \a x).
1057 For more information, see the OpenGL/ES 2.0 documentation for
1058 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1060 This convenience function will do nothing on OpenGL/ES 1.x systems.
1064 \fn void QGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1066 Convenience function that calls glUniform1iv(\a location, \a count, \a v).
1068 For more information, see the OpenGL/ES 2.0 documentation for
1069 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
1071 This convenience function will do nothing on OpenGL/ES 1.x systems.
1075 \fn void QGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1077 Convenience function that calls glUniform2f(\a location, \a x, \a y).
1079 For more information, see the OpenGL/ES 2.0 documentation for
1080 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1082 This convenience function will do nothing on OpenGL/ES 1.x systems.
1086 \fn void QGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1088 Convenience function that calls glUniform2fv(\a location, \a count, \a v).
1090 For more information, see the OpenGL/ES 2.0 documentation for
1091 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
1093 This convenience function will do nothing on OpenGL/ES 1.x systems.
1097 \fn void QGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1099 Convenience function that calls glUniform2i(\a location, \a x, \a y).
1101 For more information, see the OpenGL/ES 2.0 documentation for
1102 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1104 This convenience function will do nothing on OpenGL/ES 1.x systems.
1108 \fn void QGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1110 Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1112 For more information, see the OpenGL/ES 2.0 documentation for
1113 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1115 This convenience function will do nothing on OpenGL/ES 1.x systems.
1119 \fn void QGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1121 Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1123 For more information, see the OpenGL/ES 2.0 documentation for
1124 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1126 This convenience function will do nothing on OpenGL/ES 1.x systems.
1130 \fn void QGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1132 Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1134 For more information, see the OpenGL/ES 2.0 documentation for
1135 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1137 This convenience function will do nothing on OpenGL/ES 1.x systems.
1141 \fn void QGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1143 Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1145 For more information, see the OpenGL/ES 2.0 documentation for
1146 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1148 This convenience function will do nothing on OpenGL/ES 1.x systems.
1152 \fn void QGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1154 Convenience function that calls glUniform3iv(\a location, \a count, \a v).
1156 For more information, see the OpenGL/ES 2.0 documentation for
1157 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
1159 This convenience function will do nothing on OpenGL/ES 1.x systems.
1163 \fn void QGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1165 Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1167 For more information, see the OpenGL/ES 2.0 documentation for
1168 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1170 This convenience function will do nothing on OpenGL/ES 1.x systems.
1174 \fn void QGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1176 Convenience function that calls glUniform4fv(\a location, \a count, \a v).
1178 For more information, see the OpenGL/ES 2.0 documentation for
1179 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
1181 This convenience function will do nothing on OpenGL/ES 1.x systems.
1185 \fn void QGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1187 Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1189 For more information, see the OpenGL/ES 2.0 documentation for
1190 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1192 This convenience function will do nothing on OpenGL/ES 1.x systems.
1196 \fn void QGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1198 Convenience function that calls glUniform4iv(\a location, \a count, \a v).
1200 For more information, see the OpenGL/ES 2.0 documentation for
1201 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
1203 This convenience function will do nothing on OpenGL/ES 1.x systems.
1207 \fn void QGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1209 Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1211 For more information, see the OpenGL/ES 2.0 documentation for
1212 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1214 This convenience function will do nothing on OpenGL/ES 1.x systems.
1218 \fn void QGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1220 Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1222 For more information, see the OpenGL/ES 2.0 documentation for
1223 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1225 This convenience function will do nothing on OpenGL/ES 1.x systems.
1229 \fn void QGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1231 Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1233 For more information, see the OpenGL/ES 2.0 documentation for
1234 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1236 This convenience function will do nothing on OpenGL/ES 1.x systems.
1240 \fn void QGLFunctions::glUseProgram(GLuint program)
1242 Convenience function that calls glUseProgram(\a program).
1244 For more information, see the OpenGL/ES 2.0 documentation for
1245 \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1247 This convenience function will do nothing on OpenGL/ES 1.x systems.
1251 \fn void QGLFunctions::glValidateProgram(GLuint program)
1253 Convenience function that calls glValidateProgram(\a program).
1255 For more information, see the OpenGL/ES 2.0 documentation for
1256 \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1258 This convenience function will do nothing on OpenGL/ES 1.x systems.
1262 \fn void QGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1264 Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1266 For more information, see the OpenGL/ES 2.0 documentation for
1267 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1269 This convenience function will do nothing on OpenGL/ES 1.x systems.
1273 \fn void QGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1275 Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1277 For more information, see the OpenGL/ES 2.0 documentation for
1278 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1280 This convenience function will do nothing on OpenGL/ES 1.x systems.
1284 \fn void QGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1286 Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1288 For more information, see the OpenGL/ES 2.0 documentation for
1289 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1291 This convenience function will do nothing on OpenGL/ES 1.x systems.
1295 \fn void QGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1297 Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1299 For more information, see the OpenGL/ES 2.0 documentation for
1300 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1302 This convenience function will do nothing on OpenGL/ES 1.x systems.
1306 \fn void QGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1308 Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1310 For more information, see the OpenGL/ES 2.0 documentation for
1311 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1313 This convenience function will do nothing on OpenGL/ES 1.x systems.
1317 \fn void QGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1319 Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1321 For more information, see the OpenGL/ES 2.0 documentation for
1322 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1324 This convenience function will do nothing on OpenGL/ES 1.x systems.
1328 \fn void QGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1330 Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1332 For more information, see the OpenGL/ES 2.0 documentation for
1333 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1335 This convenience function will do nothing on OpenGL/ES 1.x systems.
1339 \fn void QGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1341 Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1343 For more information, see the OpenGL/ES 2.0 documentation for
1344 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1346 This convenience function will do nothing on OpenGL/ES 1.x systems.
1350 \fn void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1352 Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1354 For more information, see the OpenGL/ES 2.0 documentation for
1355 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1357 This convenience function will do nothing on OpenGL/ES 1.x systems.
1360 #ifndef QT_OPENGL_ES_2
1362 static void QGLF_APIENTRY qglfResolveActiveTexture(GLenum texture)
1364 typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture);
1366 const QGLContext *context = QGLContext::currentContext();
1367 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1369 funcs->activeTexture = (type_glActiveTexture)
1370 context->getProcAddress(QLatin1String("glActiveTexture"));
1371 if (!funcs->activeTexture) {
1372 funcs->activeTexture = (type_glActiveTexture)
1373 context->getProcAddress(QLatin1String("glActiveTextureARB"));
1376 if (funcs->activeTexture)
1377 funcs->activeTexture(texture);
1379 funcs->activeTexture = qglfResolveActiveTexture;
1382 static void QGLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader)
1384 typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
1386 const QGLContext *context = QGLContext::currentContext();
1387 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1389 funcs->attachShader = (type_glAttachShader)
1390 context->getProcAddress(QLatin1String("glAttachShader"));
1391 if (!funcs->attachShader) {
1392 funcs->attachShader = (type_glAttachShader)
1393 context->getProcAddress(QLatin1String("glAttachObjectARB"));
1396 if (funcs->attachShader)
1397 funcs->attachShader(program, shader);
1399 funcs->attachShader = qglfResolveAttachShader;
1402 static void QGLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1404 typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
1406 const QGLContext *context = QGLContext::currentContext();
1407 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1409 funcs->bindAttribLocation = (type_glBindAttribLocation)
1410 context->getProcAddress(QLatin1String("glBindAttribLocation"));
1411 if (!funcs->bindAttribLocation) {
1412 funcs->bindAttribLocation = (type_glBindAttribLocation)
1413 context->getProcAddress(QLatin1String("glBindAttribLocationARB"));
1416 if (funcs->bindAttribLocation)
1417 funcs->bindAttribLocation(program, index, name);
1419 funcs->bindAttribLocation = qglfResolveBindAttribLocation;
1422 static void QGLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer)
1424 typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
1426 const QGLContext *context = QGLContext::currentContext();
1427 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1429 funcs->bindBuffer = (type_glBindBuffer)
1430 context->getProcAddress(QLatin1String("glBindBuffer"));
1432 if (!funcs->bindBuffer) {
1433 funcs->bindBuffer = (type_glBindBuffer)
1434 context->getProcAddress(QLatin1String("glBindBufferOES"));
1437 if (!funcs->bindBuffer) {
1438 funcs->bindBuffer = (type_glBindBuffer)
1439 context->getProcAddress(QLatin1String("glBindBufferEXT"));
1441 if (!funcs->bindBuffer) {
1442 funcs->bindBuffer = (type_glBindBuffer)
1443 context->getProcAddress(QLatin1String("glBindBufferARB"));
1446 if (funcs->bindBuffer)
1447 funcs->bindBuffer(target, buffer);
1449 funcs->bindBuffer = qglfResolveBindBuffer;
1452 static void QGLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1454 typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
1456 const QGLContext *context = QGLContext::currentContext();
1457 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1459 funcs->bindFramebuffer = (type_glBindFramebuffer)
1460 context->getProcAddress(QLatin1String("glBindFramebuffer"));
1462 if (!funcs->bindFramebuffer) {
1463 funcs->bindFramebuffer = (type_glBindFramebuffer)
1464 context->getProcAddress(QLatin1String("glBindFramebufferOES"));
1467 if (!funcs->bindFramebuffer) {
1468 funcs->bindFramebuffer = (type_glBindFramebuffer)
1469 context->getProcAddress(QLatin1String("glBindFramebufferEXT"));
1471 if (!funcs->bindFramebuffer) {
1472 funcs->bindFramebuffer = (type_glBindFramebuffer)
1473 context->getProcAddress(QLatin1String("glBindFramebufferARB"));
1476 if (funcs->bindFramebuffer)
1477 funcs->bindFramebuffer(target, framebuffer);
1479 funcs->bindFramebuffer = qglfResolveBindFramebuffer;
1482 static void QGLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1484 typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
1486 const QGLContext *context = QGLContext::currentContext();
1487 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1489 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1490 context->getProcAddress(QLatin1String("glBindRenderbuffer"));
1492 if (!funcs->bindRenderbuffer) {
1493 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1494 context->getProcAddress(QLatin1String("glBindRenderbufferOES"));
1497 if (!funcs->bindRenderbuffer) {
1498 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1499 context->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
1501 if (!funcs->bindRenderbuffer) {
1502 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1503 context->getProcAddress(QLatin1String("glBindRenderbufferARB"));
1506 if (funcs->bindRenderbuffer)
1507 funcs->bindRenderbuffer(target, renderbuffer);
1509 funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
1512 static void QGLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1514 typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1516 const QGLContext *context = QGLContext::currentContext();
1517 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1519 funcs->blendColor = (type_glBlendColor)
1520 context->getProcAddress(QLatin1String("glBlendColor"));
1522 if (!funcs->blendColor) {
1523 funcs->blendColor = (type_glBlendColor)
1524 context->getProcAddress(QLatin1String("glBlendColorOES"));
1527 if (!funcs->blendColor) {
1528 funcs->blendColor = (type_glBlendColor)
1529 context->getProcAddress(QLatin1String("glBlendColorEXT"));
1531 if (!funcs->blendColor) {
1532 funcs->blendColor = (type_glBlendColor)
1533 context->getProcAddress(QLatin1String("glBlendColorARB"));
1536 if (funcs->blendColor)
1537 funcs->blendColor(red, green, blue, alpha);
1539 funcs->blendColor = qglfResolveBlendColor;
1542 static void QGLF_APIENTRY qglfResolveBlendEquation(GLenum mode)
1544 typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode);
1546 const QGLContext *context = QGLContext::currentContext();
1547 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1549 funcs->blendEquation = (type_glBlendEquation)
1550 context->getProcAddress(QLatin1String("glBlendEquation"));
1552 if (!funcs->blendEquation) {
1553 funcs->blendEquation = (type_glBlendEquation)
1554 context->getProcAddress(QLatin1String("glBlendEquationOES"));
1557 if (!funcs->blendEquation) {
1558 funcs->blendEquation = (type_glBlendEquation)
1559 context->getProcAddress(QLatin1String("glBlendEquationEXT"));
1561 if (!funcs->blendEquation) {
1562 funcs->blendEquation = (type_glBlendEquation)
1563 context->getProcAddress(QLatin1String("glBlendEquationARB"));
1566 if (funcs->blendEquation)
1567 funcs->blendEquation(mode);
1569 funcs->blendEquation = qglfResolveBlendEquation;
1572 static void QGLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1574 typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
1576 const QGLContext *context = QGLContext::currentContext();
1577 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1579 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1580 context->getProcAddress(QLatin1String("glBlendEquationSeparate"));
1582 if (!funcs->blendEquationSeparate) {
1583 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1584 context->getProcAddress(QLatin1String("glBlendEquationSeparateOES"));
1587 if (!funcs->blendEquationSeparate) {
1588 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1589 context->getProcAddress(QLatin1String("glBlendEquationSeparateEXT"));
1591 if (!funcs->blendEquationSeparate) {
1592 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1593 context->getProcAddress(QLatin1String("glBlendEquationSeparateARB"));
1596 if (funcs->blendEquationSeparate)
1597 funcs->blendEquationSeparate(modeRGB, modeAlpha);
1599 funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
1602 static void QGLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1604 typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1606 const QGLContext *context = QGLContext::currentContext();
1607 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1609 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1610 context->getProcAddress(QLatin1String("glBlendFuncSeparate"));
1612 if (!funcs->blendFuncSeparate) {
1613 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1614 context->getProcAddress(QLatin1String("glBlendFuncSeparateOES"));
1617 if (!funcs->blendFuncSeparate) {
1618 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1619 context->getProcAddress(QLatin1String("glBlendFuncSeparateEXT"));
1621 if (!funcs->blendFuncSeparate) {
1622 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1623 context->getProcAddress(QLatin1String("glBlendFuncSeparateARB"));
1626 if (funcs->blendFuncSeparate)
1627 funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1629 funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
1632 static void QGLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
1634 typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
1636 const QGLContext *context = QGLContext::currentContext();
1637 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1639 funcs->bufferData = (type_glBufferData)
1640 context->getProcAddress(QLatin1String("glBufferData"));
1642 if (!funcs->bufferData) {
1643 funcs->bufferData = (type_glBufferData)
1644 context->getProcAddress(QLatin1String("glBufferDataOES"));
1647 if (!funcs->bufferData) {
1648 funcs->bufferData = (type_glBufferData)
1649 context->getProcAddress(QLatin1String("glBufferDataEXT"));
1651 if (!funcs->bufferData) {
1652 funcs->bufferData = (type_glBufferData)
1653 context->getProcAddress(QLatin1String("glBufferDataARB"));
1656 if (funcs->bufferData)
1657 funcs->bufferData(target, size, data, usage);
1659 funcs->bufferData = qglfResolveBufferData;
1662 static void QGLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
1664 typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
1666 const QGLContext *context = QGLContext::currentContext();
1667 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1669 funcs->bufferSubData = (type_glBufferSubData)
1670 context->getProcAddress(QLatin1String("glBufferSubData"));
1672 if (!funcs->bufferSubData) {
1673 funcs->bufferSubData = (type_glBufferSubData)
1674 context->getProcAddress(QLatin1String("glBufferSubDataOES"));
1677 if (!funcs->bufferSubData) {
1678 funcs->bufferSubData = (type_glBufferSubData)
1679 context->getProcAddress(QLatin1String("glBufferSubDataEXT"));
1681 if (!funcs->bufferSubData) {
1682 funcs->bufferSubData = (type_glBufferSubData)
1683 context->getProcAddress(QLatin1String("glBufferSubDataARB"));
1686 if (funcs->bufferSubData)
1687 funcs->bufferSubData(target, offset, size, data);
1689 funcs->bufferSubData = qglfResolveBufferSubData;
1692 static GLenum QGLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target)
1694 typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
1696 const QGLContext *context = QGLContext::currentContext();
1697 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1699 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1700 context->getProcAddress(QLatin1String("glCheckFramebufferStatus"));
1702 if (!funcs->checkFramebufferStatus) {
1703 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1704 context->getProcAddress(QLatin1String("glCheckFramebufferStatusOES"));
1707 if (!funcs->checkFramebufferStatus) {
1708 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1709 context->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
1711 if (!funcs->checkFramebufferStatus) {
1712 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1713 context->getProcAddress(QLatin1String("glCheckFramebufferStatusARB"));
1716 if (funcs->checkFramebufferStatus)
1717 return funcs->checkFramebufferStatus(target);
1718 funcs->checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
1722 static void QGLF_APIENTRY qglfResolveCompileShader(GLuint shader)
1724 typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
1726 const QGLContext *context = QGLContext::currentContext();
1727 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1729 funcs->compileShader = (type_glCompileShader)
1730 context->getProcAddress(QLatin1String("glCompileShader"));
1731 if (!funcs->compileShader) {
1732 funcs->compileShader = (type_glCompileShader)
1733 context->getProcAddress(QLatin1String("glCompileShader"));
1736 if (funcs->compileShader)
1737 funcs->compileShader(shader);
1739 funcs->compileShader = qglfResolveCompileShader;
1742 static void QGLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1744 typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1746 const QGLContext *context = QGLContext::currentContext();
1747 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1749 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1750 context->getProcAddress(QLatin1String("glCompressedTexImage2D"));
1752 if (!funcs->compressedTexImage2D) {
1753 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1754 context->getProcAddress(QLatin1String("glCompressedTexImage2DOES"));
1757 if (!funcs->compressedTexImage2D) {
1758 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1759 context->getProcAddress(QLatin1String("glCompressedTexImage2DEXT"));
1761 if (!funcs->compressedTexImage2D) {
1762 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1763 context->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
1766 if (funcs->compressedTexImage2D)
1767 funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1769 funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
1772 static void QGLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1774 typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
1776 const QGLContext *context = QGLContext::currentContext();
1777 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1779 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1780 context->getProcAddress(QLatin1String("glCompressedTexSubImage2D"));
1782 if (!funcs->compressedTexSubImage2D) {
1783 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1784 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DOES"));
1787 if (!funcs->compressedTexSubImage2D) {
1788 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1789 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DEXT"));
1791 if (!funcs->compressedTexSubImage2D) {
1792 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1793 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DARB"));
1796 if (funcs->compressedTexSubImage2D)
1797 funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1799 funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
1802 static GLuint QGLF_APIENTRY qglfResolveCreateProgram()
1804 typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)();
1806 const QGLContext *context = QGLContext::currentContext();
1807 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1809 funcs->createProgram = (type_glCreateProgram)
1810 context->getProcAddress(QLatin1String("glCreateProgram"));
1811 if (!funcs->createProgram) {
1812 funcs->createProgram = (type_glCreateProgram)
1813 context->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
1816 if (funcs->createProgram)
1817 return funcs->createProgram();
1818 funcs->createProgram = qglfResolveCreateProgram;
1822 static GLuint QGLF_APIENTRY qglfResolveCreateShader(GLenum type)
1824 typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type);
1826 const QGLContext *context = QGLContext::currentContext();
1827 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1829 funcs->createShader = (type_glCreateShader)
1830 context->getProcAddress(QLatin1String("glCreateShader"));
1831 if (!funcs->createShader) {
1832 funcs->createShader = (type_glCreateShader)
1833 context->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
1836 if (funcs->createShader)
1837 return funcs->createShader(type);
1838 funcs->createShader = qglfResolveCreateShader;
1842 static void QGLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1844 typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
1846 const QGLContext *context = QGLContext::currentContext();
1847 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1849 funcs->deleteBuffers = (type_glDeleteBuffers)
1850 context->getProcAddress(QLatin1String("glDeleteBuffers"));
1852 if (!funcs->deleteBuffers) {
1853 funcs->deleteBuffers = (type_glDeleteBuffers)
1854 context->getProcAddress(QLatin1String("glDeleteBuffersOES"));
1857 if (!funcs->deleteBuffers) {
1858 funcs->deleteBuffers = (type_glDeleteBuffers)
1859 context->getProcAddress(QLatin1String("glDeleteBuffersEXT"));
1861 if (!funcs->deleteBuffers) {
1862 funcs->deleteBuffers = (type_glDeleteBuffers)
1863 context->getProcAddress(QLatin1String("glDeleteBuffersARB"));
1866 if (funcs->deleteBuffers)
1867 funcs->deleteBuffers(n, buffers);
1869 funcs->deleteBuffers = qglfResolveDeleteBuffers;
1872 static void QGLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1874 typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
1876 const QGLContext *context = QGLContext::currentContext();
1877 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1879 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1880 context->getProcAddress(QLatin1String("glDeleteFramebuffers"));
1882 if (!funcs->deleteFramebuffers) {
1883 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1884 context->getProcAddress(QLatin1String("glDeleteFramebuffersOES"));
1887 if (!funcs->deleteFramebuffers) {
1888 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1889 context->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
1891 if (!funcs->deleteFramebuffers) {
1892 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1893 context->getProcAddress(QLatin1String("glDeleteFramebuffersARB"));
1896 if (funcs->deleteFramebuffers)
1897 funcs->deleteFramebuffers(n, framebuffers);
1899 funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
1902 static void QGLF_APIENTRY qglfResolveDeleteProgram(GLuint program)
1904 typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
1906 const QGLContext *context = QGLContext::currentContext();
1907 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1909 funcs->deleteProgram = (type_glDeleteProgram)
1910 context->getProcAddress(QLatin1String("glDeleteProgram"));
1911 if (!funcs->deleteProgram) {
1912 funcs->deleteProgram = (type_glDeleteProgram)
1913 context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1916 if (funcs->deleteProgram)
1917 funcs->deleteProgram(program);
1919 funcs->deleteProgram = qglfResolveDeleteProgram;
1922 static void QGLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1924 typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
1926 const QGLContext *context = QGLContext::currentContext();
1927 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1929 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1930 context->getProcAddress(QLatin1String("glDeleteRenderbuffers"));
1932 if (!funcs->deleteRenderbuffers) {
1933 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1934 context->getProcAddress(QLatin1String("glDeleteRenderbuffersOES"));
1937 if (!funcs->deleteRenderbuffers) {
1938 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1939 context->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
1941 if (!funcs->deleteRenderbuffers) {
1942 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1943 context->getProcAddress(QLatin1String("glDeleteRenderbuffersARB"));
1946 if (funcs->deleteRenderbuffers)
1947 funcs->deleteRenderbuffers(n, renderbuffers);
1949 funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
1952 static void QGLF_APIENTRY qglfResolveDeleteShader(GLuint shader)
1954 typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
1956 const QGLContext *context = QGLContext::currentContext();
1957 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1959 funcs->deleteShader = (type_glDeleteShader)
1960 context->getProcAddress(QLatin1String("glDeleteShader"));
1961 if (!funcs->deleteShader) {
1962 funcs->deleteShader = (type_glDeleteShader)
1963 context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1966 if (funcs->deleteShader)
1967 funcs->deleteShader(shader);
1969 funcs->deleteShader = qglfResolveDeleteShader;
1972 static void QGLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader)
1974 typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
1976 const QGLContext *context = QGLContext::currentContext();
1977 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1979 funcs->detachShader = (type_glDetachShader)
1980 context->getProcAddress(QLatin1String("glDetachShader"));
1981 if (!funcs->detachShader) {
1982 funcs->detachShader = (type_glDetachShader)
1983 context->getProcAddress(QLatin1String("glDetachObjectARB"));
1986 if (funcs->detachShader)
1987 funcs->detachShader(program, shader);
1989 funcs->detachShader = qglfResolveDetachShader;
1992 static void QGLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index)
1994 typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
1996 const QGLContext *context = QGLContext::currentContext();
1997 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1999 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2000 context->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
2001 if (!funcs->disableVertexAttribArray) {
2002 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2003 context->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
2006 if (funcs->disableVertexAttribArray)
2007 funcs->disableVertexAttribArray(index);
2009 funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
2012 static void QGLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index)
2014 typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
2016 const QGLContext *context = QGLContext::currentContext();
2017 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2019 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2020 context->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
2021 if (!funcs->enableVertexAttribArray) {
2022 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2023 context->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
2026 if (funcs->enableVertexAttribArray)
2027 funcs->enableVertexAttribArray(index);
2029 funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
2032 static void QGLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
2034 typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
2036 const QGLContext *context = QGLContext::currentContext();
2037 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2039 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2040 context->getProcAddress(QLatin1String("glFramebufferRenderbuffer"));
2042 if (!funcs->framebufferRenderbuffer) {
2043 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2044 context->getProcAddress(QLatin1String("glFramebufferRenderbufferOES"));
2047 if (!funcs->framebufferRenderbuffer) {
2048 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2049 context->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
2051 if (!funcs->framebufferRenderbuffer) {
2052 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2053 context->getProcAddress(QLatin1String("glFramebufferRenderbufferARB"));
2056 if (funcs->framebufferRenderbuffer)
2057 funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
2059 funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
2062 static void QGLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
2064 typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
2066 const QGLContext *context = QGLContext::currentContext();
2067 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2069 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2070 context->getProcAddress(QLatin1String("glFramebufferTexture2D"));
2072 if (!funcs->framebufferTexture2D) {
2073 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2074 context->getProcAddress(QLatin1String("glFramebufferTexture2DOES"));
2077 if (!funcs->framebufferTexture2D) {
2078 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2079 context->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
2081 if (!funcs->framebufferTexture2D) {
2082 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2083 context->getProcAddress(QLatin1String("glFramebufferTexture2DARB"));
2086 if (funcs->framebufferTexture2D)
2087 funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
2089 funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
2092 static void QGLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
2094 typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
2096 const QGLContext *context = QGLContext::currentContext();
2097 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2099 funcs->genBuffers = (type_glGenBuffers)
2100 context->getProcAddress(QLatin1String("glGenBuffers"));
2102 if (!funcs->genBuffers) {
2103 funcs->genBuffers = (type_glGenBuffers)
2104 context->getProcAddress(QLatin1String("glGenBuffersOES"));
2107 if (!funcs->genBuffers) {
2108 funcs->genBuffers = (type_glGenBuffers)
2109 context->getProcAddress(QLatin1String("glGenBuffersEXT"));
2111 if (!funcs->genBuffers) {
2112 funcs->genBuffers = (type_glGenBuffers)
2113 context->getProcAddress(QLatin1String("glGenBuffersARB"));
2116 if (funcs->genBuffers)
2117 funcs->genBuffers(n, buffers);
2119 funcs->genBuffers = qglfResolveGenBuffers;
2122 static void QGLF_APIENTRY qglfResolveGenerateMipmap(GLenum target)
2124 typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
2126 const QGLContext *context = QGLContext::currentContext();
2127 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2129 funcs->generateMipmap = (type_glGenerateMipmap)
2130 context->getProcAddress(QLatin1String("glGenerateMipmap"));
2132 if (!funcs->generateMipmap) {
2133 funcs->generateMipmap = (type_glGenerateMipmap)
2134 context->getProcAddress(QLatin1String("glGenerateMipmapOES"));
2137 if (!funcs->generateMipmap) {
2138 funcs->generateMipmap = (type_glGenerateMipmap)
2139 context->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
2141 if (!funcs->generateMipmap) {
2142 funcs->generateMipmap = (type_glGenerateMipmap)
2143 context->getProcAddress(QLatin1String("glGenerateMipmapARB"));
2146 if (funcs->generateMipmap)
2147 funcs->generateMipmap(target);
2149 funcs->generateMipmap = qglfResolveGenerateMipmap;
2152 static void QGLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
2154 typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
2156 const QGLContext *context = QGLContext::currentContext();
2157 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2159 funcs->genFramebuffers = (type_glGenFramebuffers)
2160 context->getProcAddress(QLatin1String("glGenFramebuffers"));
2162 if (!funcs->genFramebuffers) {
2163 funcs->genFramebuffers = (type_glGenFramebuffers)
2164 context->getProcAddress(QLatin1String("glGenFramebuffersOES"));
2167 if (!funcs->genFramebuffers) {
2168 funcs->genFramebuffers = (type_glGenFramebuffers)
2169 context->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
2171 if (!funcs->genFramebuffers) {
2172 funcs->genFramebuffers = (type_glGenFramebuffers)
2173 context->getProcAddress(QLatin1String("glGenFramebuffersARB"));
2176 if (funcs->genFramebuffers)
2177 funcs->genFramebuffers(n, framebuffers);
2179 funcs->genFramebuffers = qglfResolveGenFramebuffers;
2182 static void QGLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2184 typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
2186 const QGLContext *context = QGLContext::currentContext();
2187 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2189 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2190 context->getProcAddress(QLatin1String("glGenRenderbuffers"));
2192 if (!funcs->genRenderbuffers) {
2193 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2194 context->getProcAddress(QLatin1String("glGenRenderbuffersOES"));
2197 if (!funcs->genRenderbuffers) {
2198 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2199 context->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
2201 if (!funcs->genRenderbuffers) {
2202 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2203 context->getProcAddress(QLatin1String("glGenRenderbuffersARB"));
2206 if (funcs->genRenderbuffers)
2207 funcs->genRenderbuffers(n, renderbuffers);
2209 funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
2212 static void QGLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2214 typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2216 const QGLContext *context = QGLContext::currentContext();
2217 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2219 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2220 context->getProcAddress(QLatin1String("glGetActiveAttrib"));
2221 if (!funcs->getActiveAttrib) {
2222 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2223 context->getProcAddress(QLatin1String("glGetActiveAttribARB"));
2226 if (funcs->getActiveAttrib)
2227 funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
2229 funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
2232 static void QGLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2234 typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2236 const QGLContext *context = QGLContext::currentContext();
2237 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2239 funcs->getActiveUniform = (type_glGetActiveUniform)
2240 context->getProcAddress(QLatin1String("glGetActiveUniform"));
2241 if (!funcs->getActiveUniform) {
2242 funcs->getActiveUniform = (type_glGetActiveUniform)
2243 context->getProcAddress(QLatin1String("glGetActiveUniformARB"));
2246 if (funcs->getActiveUniform)
2247 funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
2249 funcs->getActiveUniform = qglfResolveGetActiveUniform;
2252 static void QGLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2254 typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
2256 const QGLContext *context = QGLContext::currentContext();
2257 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2259 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2260 context->getProcAddress(QLatin1String("glGetAttachedShaders"));
2261 if (!funcs->getAttachedShaders) {
2262 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2263 context->getProcAddress(QLatin1String("glGetAttachedObjectsARB"));
2266 if (funcs->getAttachedShaders)
2267 funcs->getAttachedShaders(program, maxcount, count, shaders);
2269 funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
2272 static int QGLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name)
2274 typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
2276 const QGLContext *context = QGLContext::currentContext();
2277 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2279 funcs->getAttribLocation = (type_glGetAttribLocation)
2280 context->getProcAddress(QLatin1String("glGetAttribLocation"));
2281 if (!funcs->getAttribLocation) {
2282 funcs->getAttribLocation = (type_glGetAttribLocation)
2283 context->getProcAddress(QLatin1String("glGetAttribLocationARB"));
2286 if (funcs->getAttribLocation)
2287 return funcs->getAttribLocation(program, name);
2288 funcs->getAttribLocation = qglfResolveGetAttribLocation;
2292 static void QGLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2294 typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2296 const QGLContext *context = QGLContext::currentContext();
2297 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2299 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2300 context->getProcAddress(QLatin1String("glGetBufferParameteriv"));
2302 if (!funcs->getBufferParameteriv) {
2303 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2304 context->getProcAddress(QLatin1String("glGetBufferParameterivOES"));
2307 if (!funcs->getBufferParameteriv) {
2308 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2309 context->getProcAddress(QLatin1String("glGetBufferParameterivEXT"));
2311 if (!funcs->getBufferParameteriv) {
2312 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2313 context->getProcAddress(QLatin1String("glGetBufferParameterivARB"));
2316 if (funcs->getBufferParameteriv)
2317 funcs->getBufferParameteriv(target, pname, params);
2319 funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
2322 static void QGLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2324 typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
2326 const QGLContext *context = QGLContext::currentContext();
2327 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2329 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2330 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameteriv"));
2332 if (!funcs->getFramebufferAttachmentParameteriv) {
2333 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2334 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivOES"));
2337 if (!funcs->getFramebufferAttachmentParameteriv) {
2338 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2339 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
2341 if (!funcs->getFramebufferAttachmentParameteriv) {
2342 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2343 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivARB"));
2346 if (funcs->getFramebufferAttachmentParameteriv)
2347 funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
2349 funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
2352 static void QGLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2354 typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
2356 const QGLContext *context = QGLContext::currentContext();
2357 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2359 funcs->getProgramiv = (type_glGetProgramiv)
2360 context->getProcAddress(QLatin1String("glGetProgramiv"));
2361 if (!funcs->getProgramiv) {
2362 funcs->getProgramiv = (type_glGetProgramiv)
2363 context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2366 if (funcs->getProgramiv)
2367 funcs->getProgramiv(program, pname, params);
2369 funcs->getProgramiv = qglfResolveGetProgramiv;
2372 static void QGLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2374 typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
2376 const QGLContext *context = QGLContext::currentContext();
2377 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2379 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2380 context->getProcAddress(QLatin1String("glGetProgramInfoLog"));
2381 if (!funcs->getProgramInfoLog) {
2382 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2383 context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2386 if (funcs->getProgramInfoLog)
2387 funcs->getProgramInfoLog(program, bufsize, length, infolog);
2389 funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
2392 static void QGLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2394 typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2396 const QGLContext *context = QGLContext::currentContext();
2397 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2399 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2400 context->getProcAddress(QLatin1String("glGetRenderbufferParameteriv"));
2402 if (!funcs->getRenderbufferParameteriv) {
2403 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2404 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivOES"));
2407 if (!funcs->getRenderbufferParameteriv) {
2408 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2409 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
2411 if (!funcs->getRenderbufferParameteriv) {
2412 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2413 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivARB"));
2416 if (funcs->getRenderbufferParameteriv)
2417 funcs->getRenderbufferParameteriv(target, pname, params);
2419 funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
2422 static void QGLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2424 typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
2426 const QGLContext *context = QGLContext::currentContext();
2427 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2429 funcs->getShaderiv = (type_glGetShaderiv)
2430 context->getProcAddress(QLatin1String("glGetShaderiv"));
2431 if (!funcs->getShaderiv) {
2432 funcs->getShaderiv = (type_glGetShaderiv)
2433 context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2436 if (funcs->getShaderiv)
2437 funcs->getShaderiv(shader, pname, params);
2439 funcs->getShaderiv = qglfResolveGetShaderiv;
2442 static void QGLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2444 typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
2446 const QGLContext *context = QGLContext::currentContext();
2447 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2449 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2450 context->getProcAddress(QLatin1String("glGetShaderInfoLog"));
2451 if (!funcs->getShaderInfoLog) {
2452 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2453 context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2456 if (funcs->getShaderInfoLog)
2457 funcs->getShaderInfoLog(shader, bufsize, length, infolog);
2459 funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
2462 static void QGLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2464 Q_UNUSED(shadertype);
2465 Q_UNUSED(precisiontype);
2466 range[0] = range[1] = precision[0] = 0;
2469 static void QGLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2471 typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
2473 const QGLContext *context = QGLContext::currentContext();
2474 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2476 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2477 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormat"));
2479 if (!funcs->getShaderPrecisionFormat) {
2480 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2481 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatOES"));
2484 if (!funcs->getShaderPrecisionFormat) {
2485 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2486 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatEXT"));
2488 if (!funcs->getShaderPrecisionFormat) {
2489 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2490 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatARB"));
2493 if (!funcs->getShaderPrecisionFormat)
2494 funcs->getShaderPrecisionFormat = qglfSpecialGetShaderPrecisionFormat;
2496 funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
2499 static void QGLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2501 typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
2503 const QGLContext *context = QGLContext::currentContext();
2504 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2506 funcs->getShaderSource = (type_glGetShaderSource)
2507 context->getProcAddress(QLatin1String("glGetShaderSource"));
2508 if (!funcs->getShaderSource) {
2509 funcs->getShaderSource = (type_glGetShaderSource)
2510 context->getProcAddress(QLatin1String("glGetShaderSourceARB"));
2513 if (funcs->getShaderSource)
2514 funcs->getShaderSource(shader, bufsize, length, source);
2516 funcs->getShaderSource = qglfResolveGetShaderSource;
2519 static void QGLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2521 typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
2523 const QGLContext *context = QGLContext::currentContext();
2524 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2526 funcs->getUniformfv = (type_glGetUniformfv)
2527 context->getProcAddress(QLatin1String("glGetUniformfv"));
2528 if (!funcs->getUniformfv) {
2529 funcs->getUniformfv = (type_glGetUniformfv)
2530 context->getProcAddress(QLatin1String("glGetUniformfvARB"));
2533 if (funcs->getUniformfv)
2534 funcs->getUniformfv(program, location, params);
2536 funcs->getUniformfv = qglfResolveGetUniformfv;
2539 static void QGLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2541 typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
2543 const QGLContext *context = QGLContext::currentContext();
2544 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2546 funcs->getUniformiv = (type_glGetUniformiv)
2547 context->getProcAddress(QLatin1String("glGetUniformiv"));
2548 if (!funcs->getUniformiv) {
2549 funcs->getUniformiv = (type_glGetUniformiv)
2550 context->getProcAddress(QLatin1String("glGetUniformivARB"));
2553 if (funcs->getUniformiv)
2554 funcs->getUniformiv(program, location, params);
2556 funcs->getUniformiv = qglfResolveGetUniformiv;
2559 static int QGLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name)
2561 typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
2563 const QGLContext *context = QGLContext::currentContext();
2564 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2566 funcs->getUniformLocation = (type_glGetUniformLocation)
2567 context->getProcAddress(QLatin1String("glGetUniformLocation"));
2568 if (!funcs->getUniformLocation) {
2569 funcs->getUniformLocation = (type_glGetUniformLocation)
2570 context->getProcAddress(QLatin1String("glGetUniformLocationARB"));
2573 if (funcs->getUniformLocation)
2574 return funcs->getUniformLocation(program, name);
2575 funcs->getUniformLocation = qglfResolveGetUniformLocation;
2579 static void QGLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2581 typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
2583 const QGLContext *context = QGLContext::currentContext();
2584 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2586 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2587 context->getProcAddress(QLatin1String("glGetVertexAttribfv"));
2588 if (!funcs->getVertexAttribfv) {
2589 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2590 context->getProcAddress(QLatin1String("glGetVertexAttribfvARB"));
2593 if (funcs->getVertexAttribfv)
2594 funcs->getVertexAttribfv(index, pname, params);
2596 funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
2599 static void QGLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2601 typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
2603 const QGLContext *context = QGLContext::currentContext();
2604 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2606 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2607 context->getProcAddress(QLatin1String("glGetVertexAttribiv"));
2608 if (!funcs->getVertexAttribiv) {
2609 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2610 context->getProcAddress(QLatin1String("glGetVertexAttribivARB"));
2613 if (funcs->getVertexAttribiv)
2614 funcs->getVertexAttribiv(index, pname, params);
2616 funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
2619 static void QGLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2621 typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
2623 const QGLContext *context = QGLContext::currentContext();
2624 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2626 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2627 context->getProcAddress(QLatin1String("glGetVertexAttribPointerv"));
2628 if (!funcs->getVertexAttribPointerv) {
2629 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2630 context->getProcAddress(QLatin1String("glGetVertexAttribPointervARB"));
2633 if (funcs->getVertexAttribPointerv)
2634 funcs->getVertexAttribPointerv(index, pname, pointer);
2636 funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
2639 static GLboolean QGLF_APIENTRY qglfResolveIsBuffer(GLuint buffer)
2641 typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
2643 const QGLContext *context = QGLContext::currentContext();
2644 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2646 funcs->isBuffer = (type_glIsBuffer)
2647 context->getProcAddress(QLatin1String("glIsBuffer"));
2649 if (!funcs->isBuffer) {
2650 funcs->isBuffer = (type_glIsBuffer)
2651 context->getProcAddress(QLatin1String("glIsBufferOES"));
2654 if (!funcs->isBuffer) {
2655 funcs->isBuffer = (type_glIsBuffer)
2656 context->getProcAddress(QLatin1String("glIsBufferEXT"));
2658 if (!funcs->isBuffer) {
2659 funcs->isBuffer = (type_glIsBuffer)
2660 context->getProcAddress(QLatin1String("glIsBufferARB"));
2663 if (funcs->isBuffer)
2664 return funcs->isBuffer(buffer);
2665 funcs->isBuffer = qglfResolveIsBuffer;
2666 return GLboolean(0);
2669 static GLboolean QGLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer)
2671 typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
2673 const QGLContext *context = QGLContext::currentContext();
2674 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2676 funcs->isFramebuffer = (type_glIsFramebuffer)
2677 context->getProcAddress(QLatin1String("glIsFramebuffer"));
2679 if (!funcs->isFramebuffer) {
2680 funcs->isFramebuffer = (type_glIsFramebuffer)
2681 context->getProcAddress(QLatin1String("glIsFramebufferOES"));
2684 if (!funcs->isFramebuffer) {
2685 funcs->isFramebuffer = (type_glIsFramebuffer)
2686 context->getProcAddress(QLatin1String("glIsFramebufferEXT"));
2688 if (!funcs->isFramebuffer) {
2689 funcs->isFramebuffer = (type_glIsFramebuffer)
2690 context->getProcAddress(QLatin1String("glIsFramebufferARB"));
2693 if (funcs->isFramebuffer)
2694 return funcs->isFramebuffer(framebuffer);
2695 funcs->isFramebuffer = qglfResolveIsFramebuffer;
2696 return GLboolean(0);
2699 static GLboolean QGLF_APIENTRY qglfSpecialIsProgram(GLuint program)
2701 return program != 0;
2704 static GLboolean QGLF_APIENTRY qglfResolveIsProgram(GLuint program)
2706 typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program);
2708 const QGLContext *context = QGLContext::currentContext();
2709 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2711 funcs->isProgram = (type_glIsProgram)
2712 context->getProcAddress(QLatin1String("glIsProgram"));
2713 if (!funcs->isProgram) {
2714 funcs->isProgram = (type_glIsProgram)
2715 context->getProcAddress(QLatin1String("glIsProgramARB"));
2718 if (!funcs->isProgram)
2719 funcs->isProgram = qglfSpecialIsProgram;
2721 return funcs->isProgram(program);
2724 static GLboolean QGLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer)
2726 typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
2728 const QGLContext *context = QGLContext::currentContext();
2729 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2731 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2732 context->getProcAddress(QLatin1String("glIsRenderbuffer"));
2734 if (!funcs->isRenderbuffer) {
2735 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2736 context->getProcAddress(QLatin1String("glIsRenderbufferOES"));
2739 if (!funcs->isRenderbuffer) {
2740 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2741 context->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
2743 if (!funcs->isRenderbuffer) {
2744 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2745 context->getProcAddress(QLatin1String("glIsRenderbufferARB"));
2748 if (funcs->isRenderbuffer)
2749 return funcs->isRenderbuffer(renderbuffer);
2750 funcs->isRenderbuffer = qglfResolveIsRenderbuffer;
2751 return GLboolean(0);
2754 static GLboolean QGLF_APIENTRY qglfSpecialIsShader(GLuint shader)
2759 static GLboolean QGLF_APIENTRY qglfResolveIsShader(GLuint shader)
2761 typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader);
2763 const QGLContext *context = QGLContext::currentContext();
2764 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2766 funcs->isShader = (type_glIsShader)
2767 context->getProcAddress(QLatin1String("glIsShader"));
2768 if (!funcs->isShader) {
2769 funcs->isShader = (type_glIsShader)
2770 context->getProcAddress(QLatin1String("glIsShaderARB"));
2773 if (!funcs->isShader)
2774 funcs->isShader = qglfSpecialIsShader;
2776 return funcs->isShader(shader);
2779 static void QGLF_APIENTRY qglfResolveLinkProgram(GLuint program)
2781 typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
2783 const QGLContext *context = QGLContext::currentContext();
2784 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2786 funcs->linkProgram = (type_glLinkProgram)
2787 context->getProcAddress(QLatin1String("glLinkProgram"));
2788 if (!funcs->linkProgram) {
2789 funcs->linkProgram = (type_glLinkProgram)
2790 context->getProcAddress(QLatin1String("glLinkProgramARB"));
2793 if (funcs->linkProgram)
2794 funcs->linkProgram(program);
2796 funcs->linkProgram = qglfResolveLinkProgram;
2799 static void QGLF_APIENTRY qglfSpecialReleaseShaderCompiler()
2803 static void QGLF_APIENTRY qglfResolveReleaseShaderCompiler()
2805 typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)();
2807 const QGLContext *context = QGLContext::currentContext();
2808 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2810 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2811 context->getProcAddress(QLatin1String("glReleaseShaderCompiler"));
2812 if (!funcs->releaseShaderCompiler) {
2813 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2814 context->getProcAddress(QLatin1String("glReleaseShaderCompilerARB"));
2817 if (!funcs->releaseShaderCompiler)
2818 funcs->releaseShaderCompiler = qglfSpecialReleaseShaderCompiler;
2820 funcs->releaseShaderCompiler();
2823 static void QGLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2825 typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
2827 const QGLContext *context = QGLContext::currentContext();
2828 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2830 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2831 context->getProcAddress(QLatin1String("glRenderbufferStorage"));
2833 if (!funcs->renderbufferStorage) {
2834 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2835 context->getProcAddress(QLatin1String("glRenderbufferStorageOES"));
2838 if (!funcs->renderbufferStorage) {
2839 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2840 context->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
2842 if (!funcs->renderbufferStorage) {
2843 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2844 context->getProcAddress(QLatin1String("glRenderbufferStorageARB"));
2847 if (funcs->renderbufferStorage)
2848 funcs->renderbufferStorage(target, internalformat, width, height);
2850 funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
2853 static void QGLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2855 typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
2857 const QGLContext *context = QGLContext::currentContext();
2858 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2860 funcs->sampleCoverage = (type_glSampleCoverage)
2861 context->getProcAddress(QLatin1String("glSampleCoverage"));
2863 if (!funcs->sampleCoverage) {
2864 funcs->sampleCoverage = (type_glSampleCoverage)
2865 context->getProcAddress(QLatin1String("glSampleCoverageOES"));
2868 if (!funcs->sampleCoverage) {
2869 funcs->sampleCoverage = (type_glSampleCoverage)
2870 context->getProcAddress(QLatin1String("glSampleCoverageEXT"));
2872 if (!funcs->sampleCoverage) {
2873 funcs->sampleCoverage = (type_glSampleCoverage)
2874 context->getProcAddress(QLatin1String("glSampleCoverageARB"));
2877 if (funcs->sampleCoverage)
2878 funcs->sampleCoverage(value, invert);
2880 funcs->sampleCoverage = qglfResolveSampleCoverage;
2883 static void QGLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2885 typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
2887 const QGLContext *context = QGLContext::currentContext();
2888 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2890 funcs->shaderBinary = (type_glShaderBinary)
2891 context->getProcAddress(QLatin1String("glShaderBinary"));
2892 if (!funcs->shaderBinary) {
2893 funcs->shaderBinary = (type_glShaderBinary)
2894 context->getProcAddress(QLatin1String("glShaderBinaryARB"));
2897 if (funcs->shaderBinary)
2898 funcs->shaderBinary(n, shaders, binaryformat, binary, length);
2900 funcs->shaderBinary = qglfResolveShaderBinary;
2903 static void QGLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2905 typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
2907 const QGLContext *context = QGLContext::currentContext();
2908 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2910 funcs->shaderSource = (type_glShaderSource)
2911 context->getProcAddress(QLatin1String("glShaderSource"));
2912 if (!funcs->shaderSource) {
2913 funcs->shaderSource = (type_glShaderSource)
2914 context->getProcAddress(QLatin1String("glShaderSourceARB"));
2917 if (funcs->shaderSource)
2918 funcs->shaderSource(shader, count, string, length);
2920 funcs->shaderSource = qglfResolveShaderSource;
2923 static void QGLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2925 typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
2927 const QGLContext *context = QGLContext::currentContext();
2928 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2930 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2931 context->getProcAddress(QLatin1String("glStencilFuncSeparate"));
2933 if (!funcs->stencilFuncSeparate) {
2934 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2935 context->getProcAddress(QLatin1String("glStencilFuncSeparateOES"));
2938 if (!funcs->stencilFuncSeparate) {
2939 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2940 context->getProcAddress(QLatin1String("glStencilFuncSeparateEXT"));
2942 if (!funcs->stencilFuncSeparate) {
2943 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2944 context->getProcAddress(QLatin1String("glStencilFuncSeparateARB"));
2947 if (funcs->stencilFuncSeparate)
2948 funcs->stencilFuncSeparate(face, func, ref, mask);
2950 funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
2953 static void QGLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2955 typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
2957 const QGLContext *context = QGLContext::currentContext();
2958 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2960 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2961 context->getProcAddress(QLatin1String("glStencilMaskSeparate"));
2963 if (!funcs->stencilMaskSeparate) {
2964 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2965 context->getProcAddress(QLatin1String("glStencilMaskSeparateOES"));
2968 if (!funcs->stencilMaskSeparate) {
2969 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2970 context->getProcAddress(QLatin1String("glStencilMaskSeparateEXT"));
2972 if (!funcs->stencilMaskSeparate) {
2973 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2974 context->getProcAddress(QLatin1String("glStencilMaskSeparateARB"));
2977 if (funcs->stencilMaskSeparate)
2978 funcs->stencilMaskSeparate(face, mask);
2980 funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
2983 static void QGLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2985 typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
2987 const QGLContext *context = QGLContext::currentContext();
2988 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2990 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2991 context->getProcAddress(QLatin1String("glStencilOpSeparate"));
2993 if (!funcs->stencilOpSeparate) {
2994 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2995 context->getProcAddress(QLatin1String("glStencilOpSeparateOES"));
2998 if (!funcs->stencilOpSeparate) {
2999 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3000 context->getProcAddress(QLatin1String("glStencilOpSeparateEXT"));
3002 if (!funcs->stencilOpSeparate) {
3003 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3004 context->getProcAddress(QLatin1String("glStencilOpSeparateARB"));
3007 if (funcs->stencilOpSeparate)
3008 funcs->stencilOpSeparate(face, fail, zfail, zpass);
3010 funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
3013 static void QGLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x)
3015 typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
3017 const QGLContext *context = QGLContext::currentContext();
3018 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3020 funcs->uniform1f = (type_glUniform1f)
3021 context->getProcAddress(QLatin1String("glUniform1f"));
3022 if (!funcs->uniform1f) {
3023 funcs->uniform1f = (type_glUniform1f)
3024 context->getProcAddress(QLatin1String("glUniform1fARB"));
3027 if (funcs->uniform1f)
3028 funcs->uniform1f(location, x);
3030 funcs->uniform1f = qglfResolveUniform1f;
3033 static void QGLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
3035 typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
3037 const QGLContext *context = QGLContext::currentContext();
3038 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3040 funcs->uniform1fv = (type_glUniform1fv)
3041 context->getProcAddress(QLatin1String("glUniform1fv"));
3042 if (!funcs->uniform1fv) {
3043 funcs->uniform1fv = (type_glUniform1fv)
3044 context->getProcAddress(QLatin1String("glUniform1fvARB"));
3047 if (funcs->uniform1fv)
3048 funcs->uniform1fv(location, count, v);
3050 funcs->uniform1fv = qglfResolveUniform1fv;
3053 static void QGLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x)
3055 typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
3057 const QGLContext *context = QGLContext::currentContext();
3058 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3060 funcs->uniform1i = (type_glUniform1i)
3061 context->getProcAddress(QLatin1String("glUniform1i"));
3062 if (!funcs->uniform1i) {
3063 funcs->uniform1i = (type_glUniform1i)
3064 context->getProcAddress(QLatin1String("glUniform1iARB"));
3067 if (funcs->uniform1i)
3068 funcs->uniform1i(location, x);
3070 funcs->uniform1i = qglfResolveUniform1i;
3073 static void QGLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
3075 typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
3077 const QGLContext *context = QGLContext::currentContext();
3078 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3080 funcs->uniform1iv = (type_glUniform1iv)
3081 context->getProcAddress(QLatin1String("glUniform1iv"));
3082 if (!funcs->uniform1iv) {
3083 funcs->uniform1iv = (type_glUniform1iv)
3084 context->getProcAddress(QLatin1String("glUniform1ivARB"));
3087 if (funcs->uniform1iv)
3088 funcs->uniform1iv(location, count, v);
3090 funcs->uniform1iv = qglfResolveUniform1iv;
3093 static void QGLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
3095 typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
3097 const QGLContext *context = QGLContext::currentContext();
3098 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3100 funcs->uniform2f = (type_glUniform2f)
3101 context->getProcAddress(QLatin1String("glUniform2f"));
3102 if (!funcs->uniform2f) {
3103 funcs->uniform2f = (type_glUniform2f)
3104 context->getProcAddress(QLatin1String("glUniform2fARB"));
3107 if (funcs->uniform2f)
3108 funcs->uniform2f(location, x, y);
3110 funcs->uniform2f = qglfResolveUniform2f;
3113 static void QGLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
3115 typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
3117 const QGLContext *context = QGLContext::currentContext();
3118 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3120 funcs->uniform2fv = (type_glUniform2fv)
3121 context->getProcAddress(QLatin1String("glUniform2fv"));
3122 if (!funcs->uniform2fv) {
3123 funcs->uniform2fv = (type_glUniform2fv)
3124 context->getProcAddress(QLatin1String("glUniform2fvARB"));
3127 if (funcs->uniform2fv)
3128 funcs->uniform2fv(location, count, v);
3130 funcs->uniform2fv = qglfResolveUniform2fv;
3133 static void QGLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y)
3135 typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
3137 const QGLContext *context = QGLContext::currentContext();
3138 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3140 funcs->uniform2i = (type_glUniform2i)
3141 context->getProcAddress(QLatin1String("glUniform2i"));
3142 if (!funcs->uniform2i) {
3143 funcs->uniform2i = (type_glUniform2i)
3144 context->getProcAddress(QLatin1String("glUniform2iARB"));
3147 if (funcs->uniform2i)
3148 funcs->uniform2i(location, x, y);
3150 funcs->uniform2i = qglfResolveUniform2i;
3153 static void QGLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
3155 typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
3157 const QGLContext *context = QGLContext::currentContext();
3158 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3160 funcs->uniform2iv = (type_glUniform2iv)
3161 context->getProcAddress(QLatin1String("glUniform2iv"));
3162 if (!funcs->uniform2iv) {
3163 funcs->uniform2iv = (type_glUniform2iv)
3164 context->getProcAddress(QLatin1String("glUniform2ivARB"));
3167 if (funcs->uniform2iv)
3168 funcs->uniform2iv(location, count, v);
3170 funcs->uniform2iv = qglfResolveUniform2iv;
3173 static void QGLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
3175 typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
3177 const QGLContext *context = QGLContext::currentContext();
3178 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3180 funcs->uniform3f = (type_glUniform3f)
3181 context->getProcAddress(QLatin1String("glUniform3f"));
3182 if (!funcs->uniform3f) {
3183 funcs->uniform3f = (type_glUniform3f)
3184 context->getProcAddress(QLatin1String("glUniform3fARB"));
3187 if (funcs->uniform3f)
3188 funcs->uniform3f(location, x, y, z);
3190 funcs->uniform3f = qglfResolveUniform3f;
3193 static void QGLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
3195 typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
3197 const QGLContext *context = QGLContext::currentContext();
3198 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3200 funcs->uniform3fv = (type_glUniform3fv)
3201 context->getProcAddress(QLatin1String("glUniform3fv"));
3202 if (!funcs->uniform3fv) {
3203 funcs->uniform3fv = (type_glUniform3fv)
3204 context->getProcAddress(QLatin1String("glUniform3fvARB"));
3207 if (funcs->uniform3fv)
3208 funcs->uniform3fv(location, count, v);
3210 funcs->uniform3fv = qglfResolveUniform3fv;
3213 static void QGLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
3215 typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
3217 const QGLContext *context = QGLContext::currentContext();
3218 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3220 funcs->uniform3i = (type_glUniform3i)
3221 context->getProcAddress(QLatin1String("glUniform3i"));
3222 if (!funcs->uniform3i) {
3223 funcs->uniform3i = (type_glUniform3i)
3224 context->getProcAddress(QLatin1String("glUniform3iARB"));
3227 if (funcs->uniform3i)
3228 funcs->uniform3i(location, x, y, z);
3230 funcs->uniform3i = qglfResolveUniform3i;
3233 static void QGLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
3235 typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
3237 const QGLContext *context = QGLContext::currentContext();
3238 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3240 funcs->uniform3iv = (type_glUniform3iv)
3241 context->getProcAddress(QLatin1String("glUniform3iv"));
3242 if (!funcs->uniform3iv) {
3243 funcs->uniform3iv = (type_glUniform3iv)
3244 context->getProcAddress(QLatin1String("glUniform3ivARB"));
3247 if (funcs->uniform3iv)
3248 funcs->uniform3iv(location, count, v);
3250 funcs->uniform3iv = qglfResolveUniform3iv;
3253 static void QGLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3255 typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3257 const QGLContext *context = QGLContext::currentContext();
3258 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3260 funcs->uniform4f = (type_glUniform4f)
3261 context->getProcAddress(QLatin1String("glUniform4f"));
3262 if (!funcs->uniform4f) {
3263 funcs->uniform4f = (type_glUniform4f)
3264 context->getProcAddress(QLatin1String("glUniform4fARB"));
3267 if (funcs->uniform4f)
3268 funcs->uniform4f(location, x, y, z, w);
3270 funcs->uniform4f = qglfResolveUniform4f;
3273 static void QGLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
3275 typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
3277 const QGLContext *context = QGLContext::currentContext();
3278 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3280 funcs->uniform4fv = (type_glUniform4fv)
3281 context->getProcAddress(QLatin1String("glUniform4fv"));
3282 if (!funcs->uniform4fv) {
3283 funcs->uniform4fv = (type_glUniform4fv)
3284 context->getProcAddress(QLatin1String("glUniform4fvARB"));
3287 if (funcs->uniform4fv)
3288 funcs->uniform4fv(location, count, v);
3290 funcs->uniform4fv = qglfResolveUniform4fv;
3293 static void QGLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
3295 typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
3297 const QGLContext *context = QGLContext::currentContext();
3298 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3300 funcs->uniform4i = (type_glUniform4i)
3301 context->getProcAddress(QLatin1String("glUniform4i"));
3302 if (!funcs->uniform4i) {
3303 funcs->uniform4i = (type_glUniform4i)
3304 context->getProcAddress(QLatin1String("glUniform4iARB"));
3307 if (funcs->uniform4i)
3308 funcs->uniform4i(location, x, y, z, w);
3310 funcs->uniform4i = qglfResolveUniform4i;
3313 static void QGLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
3315 typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
3317 const QGLContext *context = QGLContext::currentContext();
3318 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3320 funcs->uniform4iv = (type_glUniform4iv)
3321 context->getProcAddress(QLatin1String("glUniform4iv"));
3322 if (!funcs->uniform4iv) {
3323 funcs->uniform4iv = (type_glUniform4iv)
3324 context->getProcAddress(QLatin1String("glUniform4ivARB"));
3327 if (funcs->uniform4iv)
3328 funcs->uniform4iv(location, count, v);
3330 funcs->uniform4iv = qglfResolveUniform4iv;
3333 static void QGLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3335 typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3337 const QGLContext *context = QGLContext::currentContext();
3338 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3340 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3341 context->getProcAddress(QLatin1String("glUniformMatrix2fv"));
3342 if (!funcs->uniformMatrix2fv) {
3343 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3344 context->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
3347 if (funcs->uniformMatrix2fv)
3348 funcs->uniformMatrix2fv(location, count, transpose, value);
3350 funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3353 static void QGLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3355 typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3357 const QGLContext *context = QGLContext::currentContext();
3358 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3360 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3361 context->getProcAddress(QLatin1String("glUniformMatrix3fv"));
3362 if (!funcs->uniformMatrix3fv) {
3363 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3364 context->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
3367 if (funcs->uniformMatrix3fv)
3368 funcs->uniformMatrix3fv(location, count, transpose, value);
3370 funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3373 static void QGLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3375 typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3377 const QGLContext *context = QGLContext::currentContext();
3378 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3380 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3381 context->getProcAddress(QLatin1String("glUniformMatrix4fv"));
3382 if (!funcs->uniformMatrix4fv) {
3383 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3384 context->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
3387 if (funcs->uniformMatrix4fv)
3388 funcs->uniformMatrix4fv(location, count, transpose, value);
3390 funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3393 static void QGLF_APIENTRY qglfResolveUseProgram(GLuint program)
3395 typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program);
3397 const QGLContext *context = QGLContext::currentContext();
3398 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3400 funcs->useProgram = (type_glUseProgram)
3401 context->getProcAddress(QLatin1String("glUseProgram"));
3402 if (!funcs->useProgram) {
3403 funcs->useProgram = (type_glUseProgram)
3404 context->getProcAddress(QLatin1String("glUseProgramObjectARB"));
3407 if (funcs->useProgram)
3408 funcs->useProgram(program);
3410 funcs->useProgram = qglfResolveUseProgram;
3413 static void QGLF_APIENTRY qglfResolveValidateProgram(GLuint program)
3415 typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
3417 const QGLContext *context = QGLContext::currentContext();
3418 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3420 funcs->validateProgram = (type_glValidateProgram)
3421 context->getProcAddress(QLatin1String("glValidateProgram"));
3422 if (!funcs->validateProgram) {
3423 funcs->validateProgram = (type_glValidateProgram)
3424 context->getProcAddress(QLatin1String("glValidateProgramARB"));
3427 if (funcs->validateProgram)
3428 funcs->validateProgram(program);
3430 funcs->validateProgram = qglfResolveValidateProgram;
3433 static void QGLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
3435 typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
3437 const QGLContext *context = QGLContext::currentContext();
3438 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3440 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3441 context->getProcAddress(QLatin1String("glVertexAttrib1f"));
3442 if (!funcs->vertexAttrib1f) {
3443 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3444 context->getProcAddress(QLatin1String("glVertexAttrib1fARB"));
3447 if (funcs->vertexAttrib1f)
3448 funcs->vertexAttrib1f(indx, x);
3450 funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
3453 static void QGLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
3455 typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
3457 const QGLContext *context = QGLContext::currentContext();
3458 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3460 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3461 context->getProcAddress(QLatin1String("glVertexAttrib1fv"));
3462 if (!funcs->vertexAttrib1fv) {
3463 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3464 context->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
3467 if (funcs->vertexAttrib1fv)
3468 funcs->vertexAttrib1fv(indx, values);
3470 funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3473 static void QGLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
3475 typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
3477 const QGLContext *context = QGLContext::currentContext();
3478 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3480 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3481 context->getProcAddress(QLatin1String("glVertexAttrib2f"));
3482 if (!funcs->vertexAttrib2f) {
3483 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3484 context->getProcAddress(QLatin1String("glVertexAttrib2fARB"));
3487 if (funcs->vertexAttrib2f)
3488 funcs->vertexAttrib2f(indx, x, y);
3490 funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
3493 static void QGLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
3495 typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
3497 const QGLContext *context = QGLContext::currentContext();
3498 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3500 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3501 context->getProcAddress(QLatin1String("glVertexAttrib2fv"));
3502 if (!funcs->vertexAttrib2fv) {
3503 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3504 context->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
3507 if (funcs->vertexAttrib2fv)
3508 funcs->vertexAttrib2fv(indx, values);
3510 funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3513 static void QGLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
3515 typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
3517 const QGLContext *context = QGLContext::currentContext();
3518 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3520 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3521 context->getProcAddress(QLatin1String("glVertexAttrib3f"));
3522 if (!funcs->vertexAttrib3f) {
3523 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3524 context->getProcAddress(QLatin1String("glVertexAttrib3fARB"));
3527 if (funcs->vertexAttrib3f)
3528 funcs->vertexAttrib3f(indx, x, y, z);
3530 funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
3533 static void QGLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
3535 typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
3537 const QGLContext *context = QGLContext::currentContext();
3538 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3540 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3541 context->getProcAddress(QLatin1String("glVertexAttrib3fv"));
3542 if (!funcs->vertexAttrib3fv) {
3543 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3544 context->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
3547 if (funcs->vertexAttrib3fv)
3548 funcs->vertexAttrib3fv(indx, values);
3550 funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3553 static void QGLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3555 typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3557 const QGLContext *context = QGLContext::currentContext();
3558 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3560 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3561 context->getProcAddress(QLatin1String("glVertexAttrib4f"));
3562 if (!funcs->vertexAttrib4f) {
3563 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3564 context->getProcAddress(QLatin1String("glVertexAttrib4fARB"));
3567 if (funcs->vertexAttrib4f)
3568 funcs->vertexAttrib4f(indx, x, y, z, w);
3570 funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
3573 static void QGLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
3575 typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
3577 const QGLContext *context = QGLContext::currentContext();
3578 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3580 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3581 context->getProcAddress(QLatin1String("glVertexAttrib4fv"));
3582 if (!funcs->vertexAttrib4fv) {
3583 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3584 context->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
3587 if (funcs->vertexAttrib4fv)
3588 funcs->vertexAttrib4fv(indx, values);
3590 funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3593 static void QGLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
3595 typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
3597 const QGLContext *context = QGLContext::currentContext();
3598 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3600 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3601 context->getProcAddress(QLatin1String("glVertexAttribPointer"));
3602 if (!funcs->vertexAttribPointer) {
3603 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3604 context->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
3607 if (funcs->vertexAttribPointer)
3608 funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
3610 funcs->vertexAttribPointer = qglfResolveVertexAttribPointer;
3613 #endif // !QT_OPENGL_ES_2
3615 QGLFunctionsPrivate::QGLFunctionsPrivate(const QGLContext *)
3617 #ifndef QT_OPENGL_ES_2
3618 activeTexture = qglfResolveActiveTexture;
3619 attachShader = qglfResolveAttachShader;
3620 bindAttribLocation = qglfResolveBindAttribLocation;
3621 bindBuffer = qglfResolveBindBuffer;
3622 bindFramebuffer = qglfResolveBindFramebuffer;
3623 bindRenderbuffer = qglfResolveBindRenderbuffer;
3624 blendColor = qglfResolveBlendColor;
3625 blendEquation = qglfResolveBlendEquation;
3626 blendEquationSeparate = qglfResolveBlendEquationSeparate;
3627 blendFuncSeparate = qglfResolveBlendFuncSeparate;
3628 bufferData = qglfResolveBufferData;
3629 bufferSubData = qglfResolveBufferSubData;
3630 checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
3631 compileShader = qglfResolveCompileShader;
3632 compressedTexImage2D = qglfResolveCompressedTexImage2D;
3633 compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
3634 createProgram = qglfResolveCreateProgram;
3635 createShader = qglfResolveCreateShader;
3636 deleteBuffers = qglfResolveDeleteBuffers;
3637 deleteFramebuffers = qglfResolveDeleteFramebuffers;
3638 deleteProgram = qglfResolveDeleteProgram;
3639 deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
3640 deleteShader = qglfResolveDeleteShader;
3641 detachShader = qglfResolveDetachShader;
3642 disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
3643 enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
3644 framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
3645 framebufferTexture2D = qglfResolveFramebufferTexture2D;
3646 genBuffers = qglfResolveGenBuffers;
3647 generateMipmap = qglfResolveGenerateMipmap;
3648 genFramebuffers = qglfResolveGenFramebuffers;
3649 genRenderbuffers = qglfResolveGenRenderbuffers;
3650 getActiveAttrib = qglfResolveGetActiveAttrib;
3651 getActiveUniform = qglfResolveGetActiveUniform;
3652 getAttachedShaders = qglfResolveGetAttachedShaders;
3653 getAttribLocation = qglfResolveGetAttribLocation;
3654 getBufferParameteriv = qglfResolveGetBufferParameteriv;
3655 getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
3656 getProgramiv = qglfResolveGetProgramiv;
3657 getProgramInfoLog = qglfResolveGetProgramInfoLog;
3658 getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
3659 getShaderiv = qglfResolveGetShaderiv;
3660 getShaderInfoLog = qglfResolveGetShaderInfoLog;
3661 getShaderPrecisionFormat = qglfResolveGetShaderPrecisionFormat;
3662 getShaderSource = qglfResolveGetShaderSource;
3663 getUniformfv = qglfResolveGetUniformfv;
3664 getUniformiv = qglfResolveGetUniformiv;
3665 getUniformLocation = qglfResolveGetUniformLocation;
3666 getVertexAttribfv = qglfResolveGetVertexAttribfv;
3667 getVertexAttribiv = qglfResolveGetVertexAttribiv;
3668 getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
3669 isBuffer = qglfResolveIsBuffer;
3670 isFramebuffer = qglfResolveIsFramebuffer;
3671 isProgram = qglfResolveIsProgram;
3672 isRenderbuffer = qglfResolveIsRenderbuffer;
3673 isShader = qglfResolveIsShader;
3674 linkProgram = qglfResolveLinkProgram;
3675 releaseShaderCompiler = qglfResolveReleaseShaderCompiler;
3676 renderbufferStorage = qglfResolveRenderbufferStorage;
3677 sampleCoverage = qglfResolveSampleCoverage;
3678 shaderBinary = qglfResolveShaderBinary;
3679 shaderSource = qglfResolveShaderSource;
3680 stencilFuncSeparate = qglfResolveStencilFuncSeparate;
3681 stencilMaskSeparate = qglfResolveStencilMaskSeparate;
3682 stencilOpSeparate = qglfResolveStencilOpSeparate;
3683 uniform1f = qglfResolveUniform1f;
3684 uniform1fv = qglfResolveUniform1fv;
3685 uniform1i = qglfResolveUniform1i;
3686 uniform1iv = qglfResolveUniform1iv;
3687 uniform2f = qglfResolveUniform2f;
3688 uniform2fv = qglfResolveUniform2fv;
3689 uniform2i = qglfResolveUniform2i;
3690 uniform2iv = qglfResolveUniform2iv;
3691 uniform3f = qglfResolveUniform3f;
3692 uniform3fv = qglfResolveUniform3fv;
3693 uniform3i = qglfResolveUniform3i;
3694 uniform3iv = qglfResolveUniform3iv;
3695 uniform4f = qglfResolveUniform4f;
3696 uniform4fv = qglfResolveUniform4fv;
3697 uniform4i = qglfResolveUniform4i;
3698 uniform4iv = qglfResolveUniform4iv;
3699 uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3700 uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3701 uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3702 useProgram = qglfResolveUseProgram;
3703 validateProgram = qglfResolveValidateProgram;
3704 vertexAttrib1f = qglfResolveVertexAttrib1f;
3705 vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3706 vertexAttrib2f = qglfResolveVertexAttrib2f;
3707 vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3708 vertexAttrib3f = qglfResolveVertexAttrib3f;
3709 vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3710 vertexAttrib4f = qglfResolveVertexAttrib4f;
3711 vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3712 vertexAttribPointer = qglfResolveVertexAttribPointer;
3713 #endif // !QT_OPENGL_ES_2