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.
54 OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
55 common across many desktop and embedded OpenGL implementations.
56 However, it can be difficult to use the functions from that subset
57 because they need to be resolved manually on desktop systems.
59 QGLFunctions provides a guaranteed API that is available on all
60 OpenGL systems and takes care of function resolution on systems
61 that need it. The recommended way to use QGLFunctions is by
65 class MyGLWidget : public QGLWidget, protected QGLFunctions
69 MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
76 void MyGLWidget::initializeGL()
78 initializeGLFunctions();
82 The \c{paintGL()} function can then use any of the OpenGL/ES 2.0
83 functions without explicit resolution, such as glActiveTexture()
84 in the following example:
87 void MyGLWidget::paintGL()
89 glActiveTexture(GL_TEXTURE1);
90 glBindTexture(GL_TEXTURE_2D, textureId);
95 QGLFunctions can also be used directly for ad-hoc invocation
96 of OpenGL/ES 2.0 functions on all platforms:
99 QGLFunctions glFuncs(QGLContext::currentContext());
100 glFuncs.glActiveTexture(GL_TEXTURE1);
103 QGLFunctions provides wrappers for all OpenGL/ES 2.0 functions,
104 except those like \c{glDrawArrays()}, \c{glViewport()}, and
105 \c{glBindTexture()} that don't have portability issues.
107 Including the header for QGLFunctions will also define all of
108 the OpenGL/ES 2.0 macro constants that are not already defined by
109 the system's OpenGL headers, such as \c{GL_TEXTURE1} above.
111 The hasOpenGLFeature() and openGLFeatures() functions can be used
112 to determine if the OpenGL implementation has a major OpenGL/ES 2.0
113 feature. For example, the following checks if non power of two
114 textures are available:
117 QGLFunctions funcs(QGLContext::currentContext());
118 bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
123 \enum QGLFunctions::OpenGLFeature
124 This enum defines OpenGL/ES 2.0 features that may be optional
127 \value Multitexture glActiveTexture() function is available.
128 \value Shaders Shader functions are available.
129 \value Buffers Vertex and index buffer functions are available.
130 \value Framebuffers Framebuffer object functions are available.
131 \value BlendColor glBlendColor() is available.
132 \value BlendEquation glBlendEquation() is available.
133 \value BlendEquationSeparate glBlendEquationSeparate() is available.
134 \value BlendFuncSeparate glBlendFuncSeparate() is available.
135 \value BlendSubtract Blend subtract mode is available.
136 \value CompressedTextures Compressed texture functions are available.
137 \value Multisample glSampleCoverage() function is available.
138 \value StencilSeparate Separate stencil functions are available.
139 \value NPOTTextures Non power of two textures are available.
142 // Hidden private fields for additional extension data.
143 struct QGLFunctionsPrivateEx : public QGLFunctionsPrivate, public QOpenGLSharedResource
145 QGLFunctionsPrivateEx(QOpenGLContext *context)
146 : QGLFunctionsPrivate(QGLContext::fromOpenGLContext(context))
147 , QOpenGLSharedResource(context->shareGroup())
150 void invalidateResource()
155 void freeResource(QOpenGLContext *)
157 // no gl resources to free
163 Q_GLOBAL_STATIC(QOpenGLMultiGroupSharedResource, qt_gl_functions_resource)
165 static QGLFunctionsPrivateEx *qt_gl_functions(const QGLContext *context = 0)
168 context = QGLContext::currentContext();
170 QGLFunctionsPrivateEx *funcs =
171 reinterpret_cast<QGLFunctionsPrivateEx *>
172 (qt_gl_functions_resource()->value<QGLFunctionsPrivateEx>(context->contextHandle()));
177 Constructs a default function resolver. The resolver cannot
178 be used until initializeGLFunctions() is called to specify
181 \sa initializeGLFunctions()
183 QGLFunctions::QGLFunctions()
189 Constructs a function resolver for \a context. If \a context
190 is null, then the resolver will be created for the current QGLContext.
192 An object constructed in this way can only be used with \a context
193 and other contexts that share with it. Use initializeGLFunctions()
194 to change the object's context association.
196 \sa initializeGLFunctions()
198 QGLFunctions::QGLFunctions(const QGLContext *context)
199 : d_ptr(qt_gl_functions(context))
204 \fn QGLFunctions::~QGLFunctions()
206 Destroys this function resolver.
209 static int qt_gl_resolve_features()
211 #if defined(QT_OPENGL_ES_2)
212 int features = QGLFunctions::Multitexture |
213 QGLFunctions::Shaders |
214 QGLFunctions::Buffers |
215 QGLFunctions::Framebuffers |
216 QGLFunctions::BlendColor |
217 QGLFunctions::BlendEquation |
218 QGLFunctions::BlendEquationSeparate |
219 QGLFunctions::BlendFuncSeparate |
220 QGLFunctions::BlendSubtract |
221 QGLFunctions::CompressedTextures |
222 QGLFunctions::Multisample |
223 QGLFunctions::StencilSeparate;
224 QGLExtensionMatcher extensions;
225 if (extensions.match("GL_OES_texture_npot"))
226 features |= QGLFunctions::NPOTTextures;
227 if (extensions.match("GL_IMG_texture_npot"))
228 features |= QGLFunctions::NPOTTextures;
230 #elif defined(QT_OPENGL_ES)
231 int features = QGLFunctions::Multitexture |
232 QGLFunctions::Buffers |
233 QGLFunctions::CompressedTextures |
234 QGLFunctions::Multisample;
235 QGLExtensionMatcher extensions;
236 if (extensions.match("GL_OES_framebuffer_object"))
237 features |= QGLFunctions::Framebuffers;
238 if (extensions.match("GL_OES_blend_equation_separate"))
239 features |= QGLFunctions::BlendEquationSeparate;
240 if (extensions.match("GL_OES_blend_func_separate"))
241 features |= QGLFunctions::BlendFuncSeparate;
242 if (extensions.match("GL_OES_blend_subtract"))
243 features |= QGLFunctions::BlendSubtract;
244 if (extensions.match("GL_OES_texture_npot"))
245 features |= QGLFunctions::NPOTTextures;
246 if (extensions.match("GL_IMG_texture_npot"))
247 features |= QGLFunctions::NPOTTextures;
251 QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
252 QGLExtensionMatcher extensions;
254 // Recognize features by extension name.
255 if (extensions.match("GL_ARB_multitexture"))
256 features |= QGLFunctions::Multitexture;
257 if (extensions.match("GL_ARB_shader_objects"))
258 features |= QGLFunctions::Shaders;
259 if (extensions.match("GL_EXT_framebuffer_object") ||
260 extensions.match("GL_ARB_framebuffer_object"))
261 features |= QGLFunctions::Framebuffers;
262 if (extensions.match("GL_EXT_blend_color"))
263 features |= QGLFunctions::BlendColor;
264 if (extensions.match("GL_EXT_blend_equation_separate"))
265 features |= QGLFunctions::BlendEquationSeparate;
266 if (extensions.match("GL_EXT_blend_func_separate"))
267 features |= QGLFunctions::BlendFuncSeparate;
268 if (extensions.match("GL_EXT_blend_subtract"))
269 features |= QGLFunctions::BlendSubtract;
270 if (extensions.match("GL_ARB_texture_compression"))
271 features |= QGLFunctions::CompressedTextures;
272 if (extensions.match("GL_ARB_multisample"))
273 features |= QGLFunctions::Multisample;
274 if (extensions.match("GL_ARB_texture_non_power_of_two"))
275 features |= QGLFunctions::NPOTTextures;
277 // Recognize features by minimum OpenGL version.
278 if (versions & QGLFormat::OpenGL_Version_1_2) {
279 features |= QGLFunctions::BlendColor |
280 QGLFunctions::BlendEquation;
282 if (versions & QGLFormat::OpenGL_Version_1_3) {
283 features |= QGLFunctions::Multitexture |
284 QGLFunctions::CompressedTextures |
285 QGLFunctions::Multisample;
287 if (versions & QGLFormat::OpenGL_Version_1_4)
288 features |= QGLFunctions::BlendFuncSeparate;
289 if (versions & QGLFormat::OpenGL_Version_1_5)
290 features |= QGLFunctions::Buffers;
291 if (versions & QGLFormat::OpenGL_Version_2_0) {
292 features |= QGLFunctions::Shaders |
293 QGLFunctions::StencilSeparate |
294 QGLFunctions::BlendEquationSeparate |
295 QGLFunctions::NPOTTextures;
302 Returns the set of features that are present on this system's
303 OpenGL implementation.
305 It is assumed that the QGLContext associated with this function
308 \sa hasOpenGLFeature()
310 QGLFunctions::OpenGLFeatures QGLFunctions::openGLFeatures() const
312 QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
315 if (d->m_features == -1)
316 d->m_features = qt_gl_resolve_features();
317 return QGLFunctions::OpenGLFeatures(d->m_features);
321 Returns true if \a feature is present on this system's OpenGL
322 implementation; false otherwise.
324 It is assumed that the QGLContext associated with this function
329 bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const
331 QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
334 if (d->m_features == -1)
335 d->m_features = qt_gl_resolve_features();
336 return (d->m_features & int(feature)) != 0;
340 Initializes GL function resolution for \a context. If \a context
341 is null, then the current QGLContext will be used.
343 After calling this function, the QGLFunctions object can only be
344 used with \a context and other contexts that share with it.
345 Call initializeGLFunctions() again to change the object's context
348 void QGLFunctions::initializeGLFunctions(const QGLContext *context)
350 d_ptr = qt_gl_functions(context);
354 \fn void QGLFunctions::glActiveTexture(GLenum texture)
356 Convenience function that calls glActiveTexture(\a texture).
358 For more information, see the OpenGL/ES 2.0 documentation for
359 \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
363 \fn void QGLFunctions::glAttachShader(GLuint program, GLuint shader)
365 Convenience function that calls glAttachShader(\a program, \a shader).
367 For more information, see the OpenGL/ES 2.0 documentation for
368 \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
370 This convenience function will do nothing on OpenGL/ES 1.x systems.
374 \fn void QGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
376 Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
378 For more information, see the OpenGL/ES 2.0 documentation for
379 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
381 This convenience function will do nothing on OpenGL/ES 1.x systems.
385 \fn void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
387 Convenience function that calls glBindBuffer(\a target, \a buffer).
389 For more information, see the OpenGL/ES 2.0 documentation for
390 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
394 \fn void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
396 Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
398 Note that Qt will translate a \a framebuffer argument of 0 to the currently
399 bound QOpenGLContext's defaultFramebufferObject().
401 For more information, see the OpenGL/ES 2.0 documentation for
402 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
406 \fn void QGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
408 Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
410 For more information, see the OpenGL/ES 2.0 documentation for
411 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
415 \fn void QGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
417 Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
419 For more information, see the OpenGL/ES 2.0 documentation for
420 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
424 \fn void QGLFunctions::glBlendEquation(GLenum mode)
426 Convenience function that calls glBlendEquation(\a mode).
428 For more information, see the OpenGL/ES 2.0 documentation for
429 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
433 \fn void QGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
435 Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
437 For more information, see the OpenGL/ES 2.0 documentation for
438 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
442 \fn void QGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
444 Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
446 For more information, see the OpenGL/ES 2.0 documentation for
447 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
451 \fn void QGLFunctions::glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
453 Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
455 For more information, see the OpenGL/ES 2.0 documentation for
456 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
460 \fn void QGLFunctions::glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
462 Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
464 For more information, see the OpenGL/ES 2.0 documentation for
465 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
469 \fn GLenum QGLFunctions::glCheckFramebufferStatus(GLenum target)
471 Convenience function that calls glCheckFramebufferStatus(\a target).
473 For more information, see the OpenGL/ES 2.0 documentation for
474 \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
478 \fn void QGLFunctions::glClearDepthf(GLclampf depth)
480 Convenience function that calls glClearDepth(\a depth) on
481 desktop OpenGL systems and glClearDepthf(\a depth) on
482 embedded OpenGL/ES systems.
484 For more information, see the OpenGL/ES 2.0 documentation for
485 \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
489 \fn void QGLFunctions::glCompileShader(GLuint shader)
491 Convenience function that calls glCompileShader(\a shader).
493 For more information, see the OpenGL/ES 2.0 documentation for
494 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
496 This convenience function will do nothing on OpenGL/ES 1.x systems.
500 \fn void QGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
502 Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
504 For more information, see the OpenGL/ES 2.0 documentation for
505 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
509 \fn void QGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
511 Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
513 For more information, see the OpenGL/ES 2.0 documentation for
514 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
518 \fn GLuint QGLFunctions::glCreateProgram()
520 Convenience function that calls glCreateProgram().
522 For more information, see the OpenGL/ES 2.0 documentation for
523 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
525 This convenience function will do nothing on OpenGL/ES 1.x systems.
529 \fn GLuint QGLFunctions::glCreateShader(GLenum type)
531 Convenience function that calls glCreateShader(\a type).
533 For more information, see the OpenGL/ES 2.0 documentation for
534 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
536 This convenience function will do nothing on OpenGL/ES 1.x systems.
540 \fn void QGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
542 Convenience function that calls glDeleteBuffers(\a n, \a buffers).
544 For more information, see the OpenGL/ES 2.0 documentation for
545 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
549 \fn void QGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
551 Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
553 For more information, see the OpenGL/ES 2.0 documentation for
554 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
558 \fn void QGLFunctions::glDeleteProgram(GLuint program)
560 Convenience function that calls glDeleteProgram(\a program).
562 For more information, see the OpenGL/ES 2.0 documentation for
563 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
565 This convenience function will do nothing on OpenGL/ES 1.x systems.
569 \fn void QGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
571 Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
573 For more information, see the OpenGL/ES 2.0 documentation for
574 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
578 \fn void QGLFunctions::glDeleteShader(GLuint shader)
580 Convenience function that calls glDeleteShader(\a shader).
582 For more information, see the OpenGL/ES 2.0 documentation for
583 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
585 This convenience function will do nothing on OpenGL/ES 1.x systems.
589 \fn void QGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
591 Convenience function that calls glDepthRange(\a zNear, \a zFar) on
592 desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
593 embedded OpenGL/ES systems.
595 For more information, see the OpenGL/ES 2.0 documentation for
596 \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
600 \fn void QGLFunctions::glDetachShader(GLuint program, GLuint shader)
602 Convenience function that calls glDetachShader(\a program, \a shader).
604 For more information, see the OpenGL/ES 2.0 documentation for
605 \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
607 This convenience function will do nothing on OpenGL/ES 1.x systems.
611 \fn void QGLFunctions::glDisableVertexAttribArray(GLuint index)
613 Convenience function that calls glDisableVertexAttribArray(\a index).
615 For more information, see the OpenGL/ES 2.0 documentation for
616 \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
618 This convenience function will do nothing on OpenGL/ES 1.x systems.
622 \fn void QGLFunctions::glEnableVertexAttribArray(GLuint index)
624 Convenience function that calls glEnableVertexAttribArray(\a index).
626 For more information, see the OpenGL/ES 2.0 documentation for
627 \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
629 This convenience function will do nothing on OpenGL/ES 1.x systems.
633 \fn void QGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
635 Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
637 For more information, see the OpenGL/ES 2.0 documentation for
638 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
642 \fn void QGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
644 Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
646 For more information, see the OpenGL/ES 2.0 documentation for
647 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
651 \fn void QGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
653 Convenience function that calls glGenBuffers(\a n, \a buffers).
655 For more information, see the OpenGL/ES 2.0 documentation for
656 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
660 \fn void QGLFunctions::glGenerateMipmap(GLenum target)
662 Convenience function that calls glGenerateMipmap(\a target).
664 For more information, see the OpenGL/ES 2.0 documentation for
665 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
669 \fn void QGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
671 Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
673 For more information, see the OpenGL/ES 2.0 documentation for
674 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
678 \fn void QGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
680 Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
682 For more information, see the OpenGL/ES 2.0 documentation for
683 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
687 \fn void QGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
689 Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
691 For more information, see the OpenGL/ES 2.0 documentation for
692 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
694 This convenience function will do nothing on OpenGL/ES 1.x systems.
698 \fn void QGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
700 Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
702 For more information, see the OpenGL/ES 2.0 documentation for
703 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
705 This convenience function will do nothing on OpenGL/ES 1.x systems.
709 \fn void QGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
711 Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
713 For more information, see the OpenGL/ES 2.0 documentation for
714 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
716 This convenience function will do nothing on OpenGL/ES 1.x systems.
720 \fn int QGLFunctions::glGetAttribLocation(GLuint program, const char* name)
722 Convenience function that calls glGetAttribLocation(\a program, \a name).
724 For more information, see the OpenGL/ES 2.0 documentation for
725 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
727 This convenience function will do nothing on OpenGL/ES 1.x systems.
731 \fn void QGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
733 Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
735 For more information, see the OpenGL/ES 2.0 documentation for
736 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
740 \fn void QGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
742 Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
744 For more information, see the OpenGL/ES 2.0 documentation for
745 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
749 \fn void QGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
751 Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
753 For more information, see the OpenGL/ES 2.0 documentation for
754 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
756 This convenience function will do nothing on OpenGL/ES 1.x systems.
760 \fn void QGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
762 Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
764 For more information, see the OpenGL/ES 2.0 documentation for
765 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
767 This convenience function will do nothing on OpenGL/ES 1.x systems.
771 \fn void QGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
773 Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
775 For more information, see the OpenGL/ES 2.0 documentation for
776 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
780 \fn void QGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
782 Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
784 For more information, see the OpenGL/ES 2.0 documentation for
785 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
787 This convenience function will do nothing on OpenGL/ES 1.x systems.
791 \fn void QGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
793 Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
795 For more information, see the OpenGL/ES 2.0 documentation for
796 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
798 This convenience function will do nothing on OpenGL/ES 1.x systems.
802 \fn void QGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
804 Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
806 For more information, see the OpenGL/ES 2.0 documentation for
807 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
809 This convenience function will do nothing on OpenGL/ES 1.x systems.
813 \fn void QGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
815 Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
817 For more information, see the OpenGL/ES 2.0 documentation for
818 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
820 This convenience function will do nothing on OpenGL/ES 1.x systems.
824 \fn void QGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
826 Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
828 For more information, see the OpenGL/ES 2.0 documentation for
829 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
831 This convenience function will do nothing on OpenGL/ES 1.x systems.
835 \fn void QGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
837 Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
839 For more information, see the OpenGL/ES 2.0 documentation for
840 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
842 This convenience function will do nothing on OpenGL/ES 1.x systems.
846 \fn int QGLFunctions::glGetUniformLocation(GLuint program, const char* name)
848 Convenience function that calls glGetUniformLocation(\a program, \a name).
850 For more information, see the OpenGL/ES 2.0 documentation for
851 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
853 This convenience function will do nothing on OpenGL/ES 1.x systems.
857 \fn void QGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
859 Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
861 For more information, see the OpenGL/ES 2.0 documentation for
862 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
864 This convenience function will do nothing on OpenGL/ES 1.x systems.
868 \fn void QGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
870 Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
872 For more information, see the OpenGL/ES 2.0 documentation for
873 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
875 This convenience function will do nothing on OpenGL/ES 1.x systems.
879 \fn void QGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
881 Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
883 For more information, see the OpenGL/ES 2.0 documentation for
884 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
886 This convenience function will do nothing on OpenGL/ES 1.x systems.
890 \fn GLboolean QGLFunctions::glIsBuffer(GLuint buffer)
892 Convenience function that calls glIsBuffer(\a buffer).
894 For more information, see the OpenGL/ES 2.0 documentation for
895 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
899 \fn GLboolean QGLFunctions::glIsFramebuffer(GLuint framebuffer)
901 Convenience function that calls glIsFramebuffer(\a framebuffer).
903 For more information, see the OpenGL/ES 2.0 documentation for
904 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
908 \fn GLboolean QGLFunctions::glIsProgram(GLuint program)
910 Convenience function that calls glIsProgram(\a program).
912 For more information, see the OpenGL/ES 2.0 documentation for
913 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
915 This convenience function will do nothing on OpenGL/ES 1.x systems.
919 \fn GLboolean QGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
921 Convenience function that calls glIsRenderbuffer(\a renderbuffer).
923 For more information, see the OpenGL/ES 2.0 documentation for
924 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
928 \fn GLboolean QGLFunctions::glIsShader(GLuint shader)
930 Convenience function that calls glIsShader(\a shader).
932 For more information, see the OpenGL/ES 2.0 documentation for
933 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
935 This convenience function will do nothing on OpenGL/ES 1.x systems.
939 \fn void QGLFunctions::glLinkProgram(GLuint program)
941 Convenience function that calls glLinkProgram(\a program).
943 For more information, see the OpenGL/ES 2.0 documentation for
944 \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
946 This convenience function will do nothing on OpenGL/ES 1.x systems.
950 \fn void QGLFunctions::glReleaseShaderCompiler()
952 Convenience function that calls glReleaseShaderCompiler().
954 For more information, see the OpenGL/ES 2.0 documentation for
955 \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
957 This convenience function will do nothing on OpenGL/ES 1.x systems.
961 \fn void QGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
963 Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
965 For more information, see the OpenGL/ES 2.0 documentation for
966 \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
970 \fn void QGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
972 Convenience function that calls glSampleCoverage(\a value, \a invert).
974 For more information, see the OpenGL/ES 2.0 documentation for
975 \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
979 \fn void QGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
981 Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
983 For more information, see the OpenGL/ES 2.0 documentation for
984 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
986 This convenience function will do nothing on OpenGL/ES 1.x systems.
990 \fn void QGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
992 Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
994 For more information, see the OpenGL/ES 2.0 documentation for
995 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
997 This convenience function will do nothing on OpenGL/ES 1.x systems.
1001 \fn void QGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1003 Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1005 For more information, see the OpenGL/ES 2.0 documentation for
1006 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1010 \fn void QGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1012 Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1014 For more information, see the OpenGL/ES 2.0 documentation for
1015 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1019 \fn void QGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1021 Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1023 For more information, see the OpenGL/ES 2.0 documentation for
1024 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1028 \fn void QGLFunctions::glUniform1f(GLint location, GLfloat x)
1030 Convenience function that calls glUniform1f(\a location, \a x).
1032 For more information, see the OpenGL/ES 2.0 documentation for
1033 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1035 This convenience function will do nothing on OpenGL/ES 1.x systems.
1039 \fn void QGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1041 Convenience function that calls glUniform1fv(\a location, \a count, \a v).
1043 For more information, see the OpenGL/ES 2.0 documentation for
1044 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
1046 This convenience function will do nothing on OpenGL/ES 1.x systems.
1050 \fn void QGLFunctions::glUniform1i(GLint location, GLint x)
1052 Convenience function that calls glUniform1i(\a location, \a x).
1054 For more information, see the OpenGL/ES 2.0 documentation for
1055 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1057 This convenience function will do nothing on OpenGL/ES 1.x systems.
1061 \fn void QGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1063 Convenience function that calls glUniform1iv(\a location, \a count, \a v).
1065 For more information, see the OpenGL/ES 2.0 documentation for
1066 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
1068 This convenience function will do nothing on OpenGL/ES 1.x systems.
1072 \fn void QGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1074 Convenience function that calls glUniform2f(\a location, \a x, \a y).
1076 For more information, see the OpenGL/ES 2.0 documentation for
1077 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1079 This convenience function will do nothing on OpenGL/ES 1.x systems.
1083 \fn void QGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1085 Convenience function that calls glUniform2fv(\a location, \a count, \a v).
1087 For more information, see the OpenGL/ES 2.0 documentation for
1088 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
1090 This convenience function will do nothing on OpenGL/ES 1.x systems.
1094 \fn void QGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1096 Convenience function that calls glUniform2i(\a location, \a x, \a y).
1098 For more information, see the OpenGL/ES 2.0 documentation for
1099 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1101 This convenience function will do nothing on OpenGL/ES 1.x systems.
1105 \fn void QGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1107 Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1109 For more information, see the OpenGL/ES 2.0 documentation for
1110 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1112 This convenience function will do nothing on OpenGL/ES 1.x systems.
1116 \fn void QGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1118 Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1120 For more information, see the OpenGL/ES 2.0 documentation for
1121 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1123 This convenience function will do nothing on OpenGL/ES 1.x systems.
1127 \fn void QGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1129 Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1131 For more information, see the OpenGL/ES 2.0 documentation for
1132 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1134 This convenience function will do nothing on OpenGL/ES 1.x systems.
1138 \fn void QGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1140 Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1142 For more information, see the OpenGL/ES 2.0 documentation for
1143 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1145 This convenience function will do nothing on OpenGL/ES 1.x systems.
1149 \fn void QGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1151 Convenience function that calls glUniform3iv(\a location, \a count, \a v).
1153 For more information, see the OpenGL/ES 2.0 documentation for
1154 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
1156 This convenience function will do nothing on OpenGL/ES 1.x systems.
1160 \fn void QGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1162 Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1164 For more information, see the OpenGL/ES 2.0 documentation for
1165 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1167 This convenience function will do nothing on OpenGL/ES 1.x systems.
1171 \fn void QGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1173 Convenience function that calls glUniform4fv(\a location, \a count, \a v).
1175 For more information, see the OpenGL/ES 2.0 documentation for
1176 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
1178 This convenience function will do nothing on OpenGL/ES 1.x systems.
1182 \fn void QGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1184 Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1186 For more information, see the OpenGL/ES 2.0 documentation for
1187 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1189 This convenience function will do nothing on OpenGL/ES 1.x systems.
1193 \fn void QGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1195 Convenience function that calls glUniform4iv(\a location, \a count, \a v).
1197 For more information, see the OpenGL/ES 2.0 documentation for
1198 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
1200 This convenience function will do nothing on OpenGL/ES 1.x systems.
1204 \fn void QGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1206 Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1208 For more information, see the OpenGL/ES 2.0 documentation for
1209 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1211 This convenience function will do nothing on OpenGL/ES 1.x systems.
1215 \fn void QGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1217 Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1219 For more information, see the OpenGL/ES 2.0 documentation for
1220 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1222 This convenience function will do nothing on OpenGL/ES 1.x systems.
1226 \fn void QGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1228 Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1230 For more information, see the OpenGL/ES 2.0 documentation for
1231 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1233 This convenience function will do nothing on OpenGL/ES 1.x systems.
1237 \fn void QGLFunctions::glUseProgram(GLuint program)
1239 Convenience function that calls glUseProgram(\a program).
1241 For more information, see the OpenGL/ES 2.0 documentation for
1242 \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1244 This convenience function will do nothing on OpenGL/ES 1.x systems.
1248 \fn void QGLFunctions::glValidateProgram(GLuint program)
1250 Convenience function that calls glValidateProgram(\a program).
1252 For more information, see the OpenGL/ES 2.0 documentation for
1253 \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1255 This convenience function will do nothing on OpenGL/ES 1.x systems.
1259 \fn void QGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1261 Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1263 For more information, see the OpenGL/ES 2.0 documentation for
1264 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1266 This convenience function will do nothing on OpenGL/ES 1.x systems.
1270 \fn void QGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1272 Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1274 For more information, see the OpenGL/ES 2.0 documentation for
1275 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1277 This convenience function will do nothing on OpenGL/ES 1.x systems.
1281 \fn void QGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1283 Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1285 For more information, see the OpenGL/ES 2.0 documentation for
1286 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1288 This convenience function will do nothing on OpenGL/ES 1.x systems.
1292 \fn void QGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1294 Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1296 For more information, see the OpenGL/ES 2.0 documentation for
1297 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1299 This convenience function will do nothing on OpenGL/ES 1.x systems.
1303 \fn void QGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1305 Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1307 For more information, see the OpenGL/ES 2.0 documentation for
1308 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1310 This convenience function will do nothing on OpenGL/ES 1.x systems.
1314 \fn void QGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1316 Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1318 For more information, see the OpenGL/ES 2.0 documentation for
1319 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1321 This convenience function will do nothing on OpenGL/ES 1.x systems.
1325 \fn void QGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1327 Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1329 For more information, see the OpenGL/ES 2.0 documentation for
1330 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1332 This convenience function will do nothing on OpenGL/ES 1.x systems.
1336 \fn void QGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1338 Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1340 For more information, see the OpenGL/ES 2.0 documentation for
1341 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1343 This convenience function will do nothing on OpenGL/ES 1.x systems.
1347 \fn void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1349 Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1351 For more information, see the OpenGL/ES 2.0 documentation for
1352 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1354 This convenience function will do nothing on OpenGL/ES 1.x systems.
1357 #ifndef QT_OPENGL_ES_2
1359 static void QGLF_APIENTRY qglfResolveActiveTexture(GLenum texture)
1361 typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture);
1363 const QGLContext *context = QGLContext::currentContext();
1364 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1366 funcs->activeTexture = (type_glActiveTexture)
1367 context->getProcAddress(QLatin1String("glActiveTexture"));
1368 if (!funcs->activeTexture) {
1369 funcs->activeTexture = (type_glActiveTexture)
1370 context->getProcAddress(QLatin1String("glActiveTextureARB"));
1373 if (funcs->activeTexture)
1374 funcs->activeTexture(texture);
1376 funcs->activeTexture = qglfResolveActiveTexture;
1379 static void QGLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader)
1381 typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
1383 const QGLContext *context = QGLContext::currentContext();
1384 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1386 funcs->attachShader = (type_glAttachShader)
1387 context->getProcAddress(QLatin1String("glAttachShader"));
1388 if (!funcs->attachShader) {
1389 funcs->attachShader = (type_glAttachShader)
1390 context->getProcAddress(QLatin1String("glAttachObjectARB"));
1393 if (funcs->attachShader)
1394 funcs->attachShader(program, shader);
1396 funcs->attachShader = qglfResolveAttachShader;
1399 static void QGLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1401 typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
1403 const QGLContext *context = QGLContext::currentContext();
1404 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1406 funcs->bindAttribLocation = (type_glBindAttribLocation)
1407 context->getProcAddress(QLatin1String("glBindAttribLocation"));
1408 if (!funcs->bindAttribLocation) {
1409 funcs->bindAttribLocation = (type_glBindAttribLocation)
1410 context->getProcAddress(QLatin1String("glBindAttribLocationARB"));
1413 if (funcs->bindAttribLocation)
1414 funcs->bindAttribLocation(program, index, name);
1416 funcs->bindAttribLocation = qglfResolveBindAttribLocation;
1419 static void QGLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer)
1421 typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
1423 const QGLContext *context = QGLContext::currentContext();
1424 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1426 funcs->bindBuffer = (type_glBindBuffer)
1427 context->getProcAddress(QLatin1String("glBindBuffer"));
1429 if (!funcs->bindBuffer) {
1430 funcs->bindBuffer = (type_glBindBuffer)
1431 context->getProcAddress(QLatin1String("glBindBufferOES"));
1434 if (!funcs->bindBuffer) {
1435 funcs->bindBuffer = (type_glBindBuffer)
1436 context->getProcAddress(QLatin1String("glBindBufferEXT"));
1438 if (!funcs->bindBuffer) {
1439 funcs->bindBuffer = (type_glBindBuffer)
1440 context->getProcAddress(QLatin1String("glBindBufferARB"));
1443 if (funcs->bindBuffer)
1444 funcs->bindBuffer(target, buffer);
1446 funcs->bindBuffer = qglfResolveBindBuffer;
1449 static void QGLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1451 typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
1453 const QGLContext *context = QGLContext::currentContext();
1454 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1456 funcs->bindFramebuffer = (type_glBindFramebuffer)
1457 context->getProcAddress(QLatin1String("glBindFramebuffer"));
1459 if (!funcs->bindFramebuffer) {
1460 funcs->bindFramebuffer = (type_glBindFramebuffer)
1461 context->getProcAddress(QLatin1String("glBindFramebufferOES"));
1464 if (!funcs->bindFramebuffer) {
1465 funcs->bindFramebuffer = (type_glBindFramebuffer)
1466 context->getProcAddress(QLatin1String("glBindFramebufferEXT"));
1468 if (!funcs->bindFramebuffer) {
1469 funcs->bindFramebuffer = (type_glBindFramebuffer)
1470 context->getProcAddress(QLatin1String("glBindFramebufferARB"));
1473 if (funcs->bindFramebuffer)
1474 funcs->bindFramebuffer(target, framebuffer);
1476 funcs->bindFramebuffer = qglfResolveBindFramebuffer;
1479 static void QGLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1481 typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
1483 const QGLContext *context = QGLContext::currentContext();
1484 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1486 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1487 context->getProcAddress(QLatin1String("glBindRenderbuffer"));
1489 if (!funcs->bindRenderbuffer) {
1490 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1491 context->getProcAddress(QLatin1String("glBindRenderbufferOES"));
1494 if (!funcs->bindRenderbuffer) {
1495 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1496 context->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
1498 if (!funcs->bindRenderbuffer) {
1499 funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1500 context->getProcAddress(QLatin1String("glBindRenderbufferARB"));
1503 if (funcs->bindRenderbuffer)
1504 funcs->bindRenderbuffer(target, renderbuffer);
1506 funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
1509 static void QGLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1511 typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1513 const QGLContext *context = QGLContext::currentContext();
1514 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1516 funcs->blendColor = (type_glBlendColor)
1517 context->getProcAddress(QLatin1String("glBlendColor"));
1519 if (!funcs->blendColor) {
1520 funcs->blendColor = (type_glBlendColor)
1521 context->getProcAddress(QLatin1String("glBlendColorOES"));
1524 if (!funcs->blendColor) {
1525 funcs->blendColor = (type_glBlendColor)
1526 context->getProcAddress(QLatin1String("glBlendColorEXT"));
1528 if (!funcs->blendColor) {
1529 funcs->blendColor = (type_glBlendColor)
1530 context->getProcAddress(QLatin1String("glBlendColorARB"));
1533 if (funcs->blendColor)
1534 funcs->blendColor(red, green, blue, alpha);
1536 funcs->blendColor = qglfResolveBlendColor;
1539 static void QGLF_APIENTRY qglfResolveBlendEquation(GLenum mode)
1541 typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode);
1543 const QGLContext *context = QGLContext::currentContext();
1544 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1546 funcs->blendEquation = (type_glBlendEquation)
1547 context->getProcAddress(QLatin1String("glBlendEquation"));
1549 if (!funcs->blendEquation) {
1550 funcs->blendEquation = (type_glBlendEquation)
1551 context->getProcAddress(QLatin1String("glBlendEquationOES"));
1554 if (!funcs->blendEquation) {
1555 funcs->blendEquation = (type_glBlendEquation)
1556 context->getProcAddress(QLatin1String("glBlendEquationEXT"));
1558 if (!funcs->blendEquation) {
1559 funcs->blendEquation = (type_glBlendEquation)
1560 context->getProcAddress(QLatin1String("glBlendEquationARB"));
1563 if (funcs->blendEquation)
1564 funcs->blendEquation(mode);
1566 funcs->blendEquation = qglfResolveBlendEquation;
1569 static void QGLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1571 typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
1573 const QGLContext *context = QGLContext::currentContext();
1574 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1576 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1577 context->getProcAddress(QLatin1String("glBlendEquationSeparate"));
1579 if (!funcs->blendEquationSeparate) {
1580 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1581 context->getProcAddress(QLatin1String("glBlendEquationSeparateOES"));
1584 if (!funcs->blendEquationSeparate) {
1585 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1586 context->getProcAddress(QLatin1String("glBlendEquationSeparateEXT"));
1588 if (!funcs->blendEquationSeparate) {
1589 funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1590 context->getProcAddress(QLatin1String("glBlendEquationSeparateARB"));
1593 if (funcs->blendEquationSeparate)
1594 funcs->blendEquationSeparate(modeRGB, modeAlpha);
1596 funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
1599 static void QGLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1601 typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1603 const QGLContext *context = QGLContext::currentContext();
1604 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1606 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1607 context->getProcAddress(QLatin1String("glBlendFuncSeparate"));
1609 if (!funcs->blendFuncSeparate) {
1610 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1611 context->getProcAddress(QLatin1String("glBlendFuncSeparateOES"));
1614 if (!funcs->blendFuncSeparate) {
1615 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1616 context->getProcAddress(QLatin1String("glBlendFuncSeparateEXT"));
1618 if (!funcs->blendFuncSeparate) {
1619 funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1620 context->getProcAddress(QLatin1String("glBlendFuncSeparateARB"));
1623 if (funcs->blendFuncSeparate)
1624 funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1626 funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
1629 static void QGLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
1631 typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
1633 const QGLContext *context = QGLContext::currentContext();
1634 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1636 funcs->bufferData = (type_glBufferData)
1637 context->getProcAddress(QLatin1String("glBufferData"));
1639 if (!funcs->bufferData) {
1640 funcs->bufferData = (type_glBufferData)
1641 context->getProcAddress(QLatin1String("glBufferDataOES"));
1644 if (!funcs->bufferData) {
1645 funcs->bufferData = (type_glBufferData)
1646 context->getProcAddress(QLatin1String("glBufferDataEXT"));
1648 if (!funcs->bufferData) {
1649 funcs->bufferData = (type_glBufferData)
1650 context->getProcAddress(QLatin1String("glBufferDataARB"));
1653 if (funcs->bufferData)
1654 funcs->bufferData(target, size, data, usage);
1656 funcs->bufferData = qglfResolveBufferData;
1659 static void QGLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
1661 typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
1663 const QGLContext *context = QGLContext::currentContext();
1664 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1666 funcs->bufferSubData = (type_glBufferSubData)
1667 context->getProcAddress(QLatin1String("glBufferSubData"));
1669 if (!funcs->bufferSubData) {
1670 funcs->bufferSubData = (type_glBufferSubData)
1671 context->getProcAddress(QLatin1String("glBufferSubDataOES"));
1674 if (!funcs->bufferSubData) {
1675 funcs->bufferSubData = (type_glBufferSubData)
1676 context->getProcAddress(QLatin1String("glBufferSubDataEXT"));
1678 if (!funcs->bufferSubData) {
1679 funcs->bufferSubData = (type_glBufferSubData)
1680 context->getProcAddress(QLatin1String("glBufferSubDataARB"));
1683 if (funcs->bufferSubData)
1684 funcs->bufferSubData(target, offset, size, data);
1686 funcs->bufferSubData = qglfResolveBufferSubData;
1689 static GLenum QGLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target)
1691 typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
1693 const QGLContext *context = QGLContext::currentContext();
1694 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1696 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1697 context->getProcAddress(QLatin1String("glCheckFramebufferStatus"));
1699 if (!funcs->checkFramebufferStatus) {
1700 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1701 context->getProcAddress(QLatin1String("glCheckFramebufferStatusOES"));
1704 if (!funcs->checkFramebufferStatus) {
1705 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1706 context->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
1708 if (!funcs->checkFramebufferStatus) {
1709 funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1710 context->getProcAddress(QLatin1String("glCheckFramebufferStatusARB"));
1713 if (funcs->checkFramebufferStatus)
1714 return funcs->checkFramebufferStatus(target);
1715 funcs->checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
1719 static void QGLF_APIENTRY qglfResolveCompileShader(GLuint shader)
1721 typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
1723 const QGLContext *context = QGLContext::currentContext();
1724 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1726 funcs->compileShader = (type_glCompileShader)
1727 context->getProcAddress(QLatin1String("glCompileShader"));
1728 if (!funcs->compileShader) {
1729 funcs->compileShader = (type_glCompileShader)
1730 context->getProcAddress(QLatin1String("glCompileShader"));
1733 if (funcs->compileShader)
1734 funcs->compileShader(shader);
1736 funcs->compileShader = qglfResolveCompileShader;
1739 static void QGLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1741 typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1743 const QGLContext *context = QGLContext::currentContext();
1744 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1746 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1747 context->getProcAddress(QLatin1String("glCompressedTexImage2D"));
1749 if (!funcs->compressedTexImage2D) {
1750 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1751 context->getProcAddress(QLatin1String("glCompressedTexImage2DOES"));
1754 if (!funcs->compressedTexImage2D) {
1755 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1756 context->getProcAddress(QLatin1String("glCompressedTexImage2DEXT"));
1758 if (!funcs->compressedTexImage2D) {
1759 funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1760 context->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
1763 if (funcs->compressedTexImage2D)
1764 funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1766 funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
1769 static void QGLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1771 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);
1773 const QGLContext *context = QGLContext::currentContext();
1774 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1776 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1777 context->getProcAddress(QLatin1String("glCompressedTexSubImage2D"));
1779 if (!funcs->compressedTexSubImage2D) {
1780 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1781 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DOES"));
1784 if (!funcs->compressedTexSubImage2D) {
1785 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1786 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DEXT"));
1788 if (!funcs->compressedTexSubImage2D) {
1789 funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1790 context->getProcAddress(QLatin1String("glCompressedTexSubImage2DARB"));
1793 if (funcs->compressedTexSubImage2D)
1794 funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1796 funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
1799 static GLuint QGLF_APIENTRY qglfResolveCreateProgram()
1801 typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)();
1803 const QGLContext *context = QGLContext::currentContext();
1804 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1806 funcs->createProgram = (type_glCreateProgram)
1807 context->getProcAddress(QLatin1String("glCreateProgram"));
1808 if (!funcs->createProgram) {
1809 funcs->createProgram = (type_glCreateProgram)
1810 context->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
1813 if (funcs->createProgram)
1814 return funcs->createProgram();
1815 funcs->createProgram = qglfResolveCreateProgram;
1819 static GLuint QGLF_APIENTRY qglfResolveCreateShader(GLenum type)
1821 typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type);
1823 const QGLContext *context = QGLContext::currentContext();
1824 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1826 funcs->createShader = (type_glCreateShader)
1827 context->getProcAddress(QLatin1String("glCreateShader"));
1828 if (!funcs->createShader) {
1829 funcs->createShader = (type_glCreateShader)
1830 context->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
1833 if (funcs->createShader)
1834 return funcs->createShader(type);
1835 funcs->createShader = qglfResolveCreateShader;
1839 static void QGLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1841 typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
1843 const QGLContext *context = QGLContext::currentContext();
1844 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1846 funcs->deleteBuffers = (type_glDeleteBuffers)
1847 context->getProcAddress(QLatin1String("glDeleteBuffers"));
1849 if (!funcs->deleteBuffers) {
1850 funcs->deleteBuffers = (type_glDeleteBuffers)
1851 context->getProcAddress(QLatin1String("glDeleteBuffersOES"));
1854 if (!funcs->deleteBuffers) {
1855 funcs->deleteBuffers = (type_glDeleteBuffers)
1856 context->getProcAddress(QLatin1String("glDeleteBuffersEXT"));
1858 if (!funcs->deleteBuffers) {
1859 funcs->deleteBuffers = (type_glDeleteBuffers)
1860 context->getProcAddress(QLatin1String("glDeleteBuffersARB"));
1863 if (funcs->deleteBuffers)
1864 funcs->deleteBuffers(n, buffers);
1866 funcs->deleteBuffers = qglfResolveDeleteBuffers;
1869 static void QGLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1871 typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
1873 const QGLContext *context = QGLContext::currentContext();
1874 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1876 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1877 context->getProcAddress(QLatin1String("glDeleteFramebuffers"));
1879 if (!funcs->deleteFramebuffers) {
1880 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1881 context->getProcAddress(QLatin1String("glDeleteFramebuffersOES"));
1884 if (!funcs->deleteFramebuffers) {
1885 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1886 context->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
1888 if (!funcs->deleteFramebuffers) {
1889 funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1890 context->getProcAddress(QLatin1String("glDeleteFramebuffersARB"));
1893 if (funcs->deleteFramebuffers)
1894 funcs->deleteFramebuffers(n, framebuffers);
1896 funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
1899 static void QGLF_APIENTRY qglfResolveDeleteProgram(GLuint program)
1901 typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
1903 const QGLContext *context = QGLContext::currentContext();
1904 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1906 funcs->deleteProgram = (type_glDeleteProgram)
1907 context->getProcAddress(QLatin1String("glDeleteProgram"));
1908 if (!funcs->deleteProgram) {
1909 funcs->deleteProgram = (type_glDeleteProgram)
1910 context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1913 if (funcs->deleteProgram)
1914 funcs->deleteProgram(program);
1916 funcs->deleteProgram = qglfResolveDeleteProgram;
1919 static void QGLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1921 typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
1923 const QGLContext *context = QGLContext::currentContext();
1924 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1926 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1927 context->getProcAddress(QLatin1String("glDeleteRenderbuffers"));
1929 if (!funcs->deleteRenderbuffers) {
1930 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1931 context->getProcAddress(QLatin1String("glDeleteRenderbuffersOES"));
1934 if (!funcs->deleteRenderbuffers) {
1935 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1936 context->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
1938 if (!funcs->deleteRenderbuffers) {
1939 funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1940 context->getProcAddress(QLatin1String("glDeleteRenderbuffersARB"));
1943 if (funcs->deleteRenderbuffers)
1944 funcs->deleteRenderbuffers(n, renderbuffers);
1946 funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
1949 static void QGLF_APIENTRY qglfResolveDeleteShader(GLuint shader)
1951 typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
1953 const QGLContext *context = QGLContext::currentContext();
1954 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1956 funcs->deleteShader = (type_glDeleteShader)
1957 context->getProcAddress(QLatin1String("glDeleteShader"));
1958 if (!funcs->deleteShader) {
1959 funcs->deleteShader = (type_glDeleteShader)
1960 context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1963 if (funcs->deleteShader)
1964 funcs->deleteShader(shader);
1966 funcs->deleteShader = qglfResolveDeleteShader;
1969 static void QGLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader)
1971 typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
1973 const QGLContext *context = QGLContext::currentContext();
1974 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1976 funcs->detachShader = (type_glDetachShader)
1977 context->getProcAddress(QLatin1String("glDetachShader"));
1978 if (!funcs->detachShader) {
1979 funcs->detachShader = (type_glDetachShader)
1980 context->getProcAddress(QLatin1String("glDetachObjectARB"));
1983 if (funcs->detachShader)
1984 funcs->detachShader(program, shader);
1986 funcs->detachShader = qglfResolveDetachShader;
1989 static void QGLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index)
1991 typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
1993 const QGLContext *context = QGLContext::currentContext();
1994 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1996 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
1997 context->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
1998 if (!funcs->disableVertexAttribArray) {
1999 funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2000 context->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
2003 if (funcs->disableVertexAttribArray)
2004 funcs->disableVertexAttribArray(index);
2006 funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
2009 static void QGLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index)
2011 typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
2013 const QGLContext *context = QGLContext::currentContext();
2014 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2016 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2017 context->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
2018 if (!funcs->enableVertexAttribArray) {
2019 funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2020 context->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
2023 if (funcs->enableVertexAttribArray)
2024 funcs->enableVertexAttribArray(index);
2026 funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
2029 static void QGLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
2031 typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
2033 const QGLContext *context = QGLContext::currentContext();
2034 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2036 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2037 context->getProcAddress(QLatin1String("glFramebufferRenderbuffer"));
2039 if (!funcs->framebufferRenderbuffer) {
2040 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2041 context->getProcAddress(QLatin1String("glFramebufferRenderbufferOES"));
2044 if (!funcs->framebufferRenderbuffer) {
2045 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2046 context->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
2048 if (!funcs->framebufferRenderbuffer) {
2049 funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2050 context->getProcAddress(QLatin1String("glFramebufferRenderbufferARB"));
2053 if (funcs->framebufferRenderbuffer)
2054 funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
2056 funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
2059 static void QGLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
2061 typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
2063 const QGLContext *context = QGLContext::currentContext();
2064 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2066 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2067 context->getProcAddress(QLatin1String("glFramebufferTexture2D"));
2069 if (!funcs->framebufferTexture2D) {
2070 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2071 context->getProcAddress(QLatin1String("glFramebufferTexture2DOES"));
2074 if (!funcs->framebufferTexture2D) {
2075 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2076 context->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
2078 if (!funcs->framebufferTexture2D) {
2079 funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2080 context->getProcAddress(QLatin1String("glFramebufferTexture2DARB"));
2083 if (funcs->framebufferTexture2D)
2084 funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
2086 funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
2089 static void QGLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
2091 typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
2093 const QGLContext *context = QGLContext::currentContext();
2094 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2096 funcs->genBuffers = (type_glGenBuffers)
2097 context->getProcAddress(QLatin1String("glGenBuffers"));
2099 if (!funcs->genBuffers) {
2100 funcs->genBuffers = (type_glGenBuffers)
2101 context->getProcAddress(QLatin1String("glGenBuffersOES"));
2104 if (!funcs->genBuffers) {
2105 funcs->genBuffers = (type_glGenBuffers)
2106 context->getProcAddress(QLatin1String("glGenBuffersEXT"));
2108 if (!funcs->genBuffers) {
2109 funcs->genBuffers = (type_glGenBuffers)
2110 context->getProcAddress(QLatin1String("glGenBuffersARB"));
2113 if (funcs->genBuffers)
2114 funcs->genBuffers(n, buffers);
2116 funcs->genBuffers = qglfResolveGenBuffers;
2119 static void QGLF_APIENTRY qglfResolveGenerateMipmap(GLenum target)
2121 typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
2123 const QGLContext *context = QGLContext::currentContext();
2124 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2126 funcs->generateMipmap = (type_glGenerateMipmap)
2127 context->getProcAddress(QLatin1String("glGenerateMipmap"));
2129 if (!funcs->generateMipmap) {
2130 funcs->generateMipmap = (type_glGenerateMipmap)
2131 context->getProcAddress(QLatin1String("glGenerateMipmapOES"));
2134 if (!funcs->generateMipmap) {
2135 funcs->generateMipmap = (type_glGenerateMipmap)
2136 context->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
2138 if (!funcs->generateMipmap) {
2139 funcs->generateMipmap = (type_glGenerateMipmap)
2140 context->getProcAddress(QLatin1String("glGenerateMipmapARB"));
2143 if (funcs->generateMipmap)
2144 funcs->generateMipmap(target);
2146 funcs->generateMipmap = qglfResolveGenerateMipmap;
2149 static void QGLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
2151 typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
2153 const QGLContext *context = QGLContext::currentContext();
2154 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2156 funcs->genFramebuffers = (type_glGenFramebuffers)
2157 context->getProcAddress(QLatin1String("glGenFramebuffers"));
2159 if (!funcs->genFramebuffers) {
2160 funcs->genFramebuffers = (type_glGenFramebuffers)
2161 context->getProcAddress(QLatin1String("glGenFramebuffersOES"));
2164 if (!funcs->genFramebuffers) {
2165 funcs->genFramebuffers = (type_glGenFramebuffers)
2166 context->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
2168 if (!funcs->genFramebuffers) {
2169 funcs->genFramebuffers = (type_glGenFramebuffers)
2170 context->getProcAddress(QLatin1String("glGenFramebuffersARB"));
2173 if (funcs->genFramebuffers)
2174 funcs->genFramebuffers(n, framebuffers);
2176 funcs->genFramebuffers = qglfResolveGenFramebuffers;
2179 static void QGLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2181 typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
2183 const QGLContext *context = QGLContext::currentContext();
2184 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2186 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2187 context->getProcAddress(QLatin1String("glGenRenderbuffers"));
2189 if (!funcs->genRenderbuffers) {
2190 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2191 context->getProcAddress(QLatin1String("glGenRenderbuffersOES"));
2194 if (!funcs->genRenderbuffers) {
2195 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2196 context->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
2198 if (!funcs->genRenderbuffers) {
2199 funcs->genRenderbuffers = (type_glGenRenderbuffers)
2200 context->getProcAddress(QLatin1String("glGenRenderbuffersARB"));
2203 if (funcs->genRenderbuffers)
2204 funcs->genRenderbuffers(n, renderbuffers);
2206 funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
2209 static void QGLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2211 typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2213 const QGLContext *context = QGLContext::currentContext();
2214 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2216 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2217 context->getProcAddress(QLatin1String("glGetActiveAttrib"));
2218 if (!funcs->getActiveAttrib) {
2219 funcs->getActiveAttrib = (type_glGetActiveAttrib)
2220 context->getProcAddress(QLatin1String("glGetActiveAttribARB"));
2223 if (funcs->getActiveAttrib)
2224 funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
2226 funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
2229 static void QGLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2231 typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2233 const QGLContext *context = QGLContext::currentContext();
2234 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2236 funcs->getActiveUniform = (type_glGetActiveUniform)
2237 context->getProcAddress(QLatin1String("glGetActiveUniform"));
2238 if (!funcs->getActiveUniform) {
2239 funcs->getActiveUniform = (type_glGetActiveUniform)
2240 context->getProcAddress(QLatin1String("glGetActiveUniformARB"));
2243 if (funcs->getActiveUniform)
2244 funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
2246 funcs->getActiveUniform = qglfResolveGetActiveUniform;
2249 static void QGLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2251 typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
2253 const QGLContext *context = QGLContext::currentContext();
2254 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2256 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2257 context->getProcAddress(QLatin1String("glGetAttachedShaders"));
2258 if (!funcs->getAttachedShaders) {
2259 funcs->getAttachedShaders = (type_glGetAttachedShaders)
2260 context->getProcAddress(QLatin1String("glGetAttachedObjectsARB"));
2263 if (funcs->getAttachedShaders)
2264 funcs->getAttachedShaders(program, maxcount, count, shaders);
2266 funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
2269 static int QGLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name)
2271 typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
2273 const QGLContext *context = QGLContext::currentContext();
2274 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2276 funcs->getAttribLocation = (type_glGetAttribLocation)
2277 context->getProcAddress(QLatin1String("glGetAttribLocation"));
2278 if (!funcs->getAttribLocation) {
2279 funcs->getAttribLocation = (type_glGetAttribLocation)
2280 context->getProcAddress(QLatin1String("glGetAttribLocationARB"));
2283 if (funcs->getAttribLocation)
2284 return funcs->getAttribLocation(program, name);
2285 funcs->getAttribLocation = qglfResolveGetAttribLocation;
2289 static void QGLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2291 typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2293 const QGLContext *context = QGLContext::currentContext();
2294 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2296 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2297 context->getProcAddress(QLatin1String("glGetBufferParameteriv"));
2299 if (!funcs->getBufferParameteriv) {
2300 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2301 context->getProcAddress(QLatin1String("glGetBufferParameterivOES"));
2304 if (!funcs->getBufferParameteriv) {
2305 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2306 context->getProcAddress(QLatin1String("glGetBufferParameterivEXT"));
2308 if (!funcs->getBufferParameteriv) {
2309 funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2310 context->getProcAddress(QLatin1String("glGetBufferParameterivARB"));
2313 if (funcs->getBufferParameteriv)
2314 funcs->getBufferParameteriv(target, pname, params);
2316 funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
2319 static void QGLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2321 typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
2323 const QGLContext *context = QGLContext::currentContext();
2324 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2326 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2327 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameteriv"));
2329 if (!funcs->getFramebufferAttachmentParameteriv) {
2330 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2331 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivOES"));
2334 if (!funcs->getFramebufferAttachmentParameteriv) {
2335 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2336 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
2338 if (!funcs->getFramebufferAttachmentParameteriv) {
2339 funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2340 context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivARB"));
2343 if (funcs->getFramebufferAttachmentParameteriv)
2344 funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
2346 funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
2349 static void QGLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2351 typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
2353 const QGLContext *context = QGLContext::currentContext();
2354 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2356 funcs->getProgramiv = (type_glGetProgramiv)
2357 context->getProcAddress(QLatin1String("glGetProgramiv"));
2358 if (!funcs->getProgramiv) {
2359 funcs->getProgramiv = (type_glGetProgramiv)
2360 context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2363 if (funcs->getProgramiv)
2364 funcs->getProgramiv(program, pname, params);
2366 funcs->getProgramiv = qglfResolveGetProgramiv;
2369 static void QGLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2371 typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
2373 const QGLContext *context = QGLContext::currentContext();
2374 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2376 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2377 context->getProcAddress(QLatin1String("glGetProgramInfoLog"));
2378 if (!funcs->getProgramInfoLog) {
2379 funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2380 context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2383 if (funcs->getProgramInfoLog)
2384 funcs->getProgramInfoLog(program, bufsize, length, infolog);
2386 funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
2389 static void QGLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2391 typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2393 const QGLContext *context = QGLContext::currentContext();
2394 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2396 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2397 context->getProcAddress(QLatin1String("glGetRenderbufferParameteriv"));
2399 if (!funcs->getRenderbufferParameteriv) {
2400 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2401 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivOES"));
2404 if (!funcs->getRenderbufferParameteriv) {
2405 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2406 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
2408 if (!funcs->getRenderbufferParameteriv) {
2409 funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2410 context->getProcAddress(QLatin1String("glGetRenderbufferParameterivARB"));
2413 if (funcs->getRenderbufferParameteriv)
2414 funcs->getRenderbufferParameteriv(target, pname, params);
2416 funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
2419 static void QGLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2421 typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
2423 const QGLContext *context = QGLContext::currentContext();
2424 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2426 funcs->getShaderiv = (type_glGetShaderiv)
2427 context->getProcAddress(QLatin1String("glGetShaderiv"));
2428 if (!funcs->getShaderiv) {
2429 funcs->getShaderiv = (type_glGetShaderiv)
2430 context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2433 if (funcs->getShaderiv)
2434 funcs->getShaderiv(shader, pname, params);
2436 funcs->getShaderiv = qglfResolveGetShaderiv;
2439 static void QGLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2441 typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
2443 const QGLContext *context = QGLContext::currentContext();
2444 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2446 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2447 context->getProcAddress(QLatin1String("glGetShaderInfoLog"));
2448 if (!funcs->getShaderInfoLog) {
2449 funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2450 context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2453 if (funcs->getShaderInfoLog)
2454 funcs->getShaderInfoLog(shader, bufsize, length, infolog);
2456 funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
2459 static void QGLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2461 Q_UNUSED(shadertype);
2462 Q_UNUSED(precisiontype);
2463 range[0] = range[1] = precision[0] = 0;
2466 static void QGLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2468 typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
2470 const QGLContext *context = QGLContext::currentContext();
2471 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2473 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2474 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormat"));
2476 if (!funcs->getShaderPrecisionFormat) {
2477 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2478 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatOES"));
2481 if (!funcs->getShaderPrecisionFormat) {
2482 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2483 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatEXT"));
2485 if (!funcs->getShaderPrecisionFormat) {
2486 funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2487 context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatARB"));
2490 if (!funcs->getShaderPrecisionFormat)
2491 funcs->getShaderPrecisionFormat = qglfSpecialGetShaderPrecisionFormat;
2493 funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
2496 static void QGLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2498 typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
2500 const QGLContext *context = QGLContext::currentContext();
2501 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2503 funcs->getShaderSource = (type_glGetShaderSource)
2504 context->getProcAddress(QLatin1String("glGetShaderSource"));
2505 if (!funcs->getShaderSource) {
2506 funcs->getShaderSource = (type_glGetShaderSource)
2507 context->getProcAddress(QLatin1String("glGetShaderSourceARB"));
2510 if (funcs->getShaderSource)
2511 funcs->getShaderSource(shader, bufsize, length, source);
2513 funcs->getShaderSource = qglfResolveGetShaderSource;
2516 static void QGLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2518 typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
2520 const QGLContext *context = QGLContext::currentContext();
2521 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2523 funcs->getUniformfv = (type_glGetUniformfv)
2524 context->getProcAddress(QLatin1String("glGetUniformfv"));
2525 if (!funcs->getUniformfv) {
2526 funcs->getUniformfv = (type_glGetUniformfv)
2527 context->getProcAddress(QLatin1String("glGetUniformfvARB"));
2530 if (funcs->getUniformfv)
2531 funcs->getUniformfv(program, location, params);
2533 funcs->getUniformfv = qglfResolveGetUniformfv;
2536 static void QGLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2538 typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
2540 const QGLContext *context = QGLContext::currentContext();
2541 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2543 funcs->getUniformiv = (type_glGetUniformiv)
2544 context->getProcAddress(QLatin1String("glGetUniformiv"));
2545 if (!funcs->getUniformiv) {
2546 funcs->getUniformiv = (type_glGetUniformiv)
2547 context->getProcAddress(QLatin1String("glGetUniformivARB"));
2550 if (funcs->getUniformiv)
2551 funcs->getUniformiv(program, location, params);
2553 funcs->getUniformiv = qglfResolveGetUniformiv;
2556 static int QGLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name)
2558 typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
2560 const QGLContext *context = QGLContext::currentContext();
2561 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2563 funcs->getUniformLocation = (type_glGetUniformLocation)
2564 context->getProcAddress(QLatin1String("glGetUniformLocation"));
2565 if (!funcs->getUniformLocation) {
2566 funcs->getUniformLocation = (type_glGetUniformLocation)
2567 context->getProcAddress(QLatin1String("glGetUniformLocationARB"));
2570 if (funcs->getUniformLocation)
2571 return funcs->getUniformLocation(program, name);
2572 funcs->getUniformLocation = qglfResolveGetUniformLocation;
2576 static void QGLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2578 typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
2580 const QGLContext *context = QGLContext::currentContext();
2581 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2583 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2584 context->getProcAddress(QLatin1String("glGetVertexAttribfv"));
2585 if (!funcs->getVertexAttribfv) {
2586 funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2587 context->getProcAddress(QLatin1String("glGetVertexAttribfvARB"));
2590 if (funcs->getVertexAttribfv)
2591 funcs->getVertexAttribfv(index, pname, params);
2593 funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
2596 static void QGLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2598 typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
2600 const QGLContext *context = QGLContext::currentContext();
2601 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2603 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2604 context->getProcAddress(QLatin1String("glGetVertexAttribiv"));
2605 if (!funcs->getVertexAttribiv) {
2606 funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2607 context->getProcAddress(QLatin1String("glGetVertexAttribivARB"));
2610 if (funcs->getVertexAttribiv)
2611 funcs->getVertexAttribiv(index, pname, params);
2613 funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
2616 static void QGLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2618 typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
2620 const QGLContext *context = QGLContext::currentContext();
2621 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2623 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2624 context->getProcAddress(QLatin1String("glGetVertexAttribPointerv"));
2625 if (!funcs->getVertexAttribPointerv) {
2626 funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2627 context->getProcAddress(QLatin1String("glGetVertexAttribPointervARB"));
2630 if (funcs->getVertexAttribPointerv)
2631 funcs->getVertexAttribPointerv(index, pname, pointer);
2633 funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
2636 static GLboolean QGLF_APIENTRY qglfResolveIsBuffer(GLuint buffer)
2638 typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
2640 const QGLContext *context = QGLContext::currentContext();
2641 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2643 funcs->isBuffer = (type_glIsBuffer)
2644 context->getProcAddress(QLatin1String("glIsBuffer"));
2646 if (!funcs->isBuffer) {
2647 funcs->isBuffer = (type_glIsBuffer)
2648 context->getProcAddress(QLatin1String("glIsBufferOES"));
2651 if (!funcs->isBuffer) {
2652 funcs->isBuffer = (type_glIsBuffer)
2653 context->getProcAddress(QLatin1String("glIsBufferEXT"));
2655 if (!funcs->isBuffer) {
2656 funcs->isBuffer = (type_glIsBuffer)
2657 context->getProcAddress(QLatin1String("glIsBufferARB"));
2660 if (funcs->isBuffer)
2661 return funcs->isBuffer(buffer);
2662 funcs->isBuffer = qglfResolveIsBuffer;
2663 return GLboolean(0);
2666 static GLboolean QGLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer)
2668 typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
2670 const QGLContext *context = QGLContext::currentContext();
2671 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2673 funcs->isFramebuffer = (type_glIsFramebuffer)
2674 context->getProcAddress(QLatin1String("glIsFramebuffer"));
2676 if (!funcs->isFramebuffer) {
2677 funcs->isFramebuffer = (type_glIsFramebuffer)
2678 context->getProcAddress(QLatin1String("glIsFramebufferOES"));
2681 if (!funcs->isFramebuffer) {
2682 funcs->isFramebuffer = (type_glIsFramebuffer)
2683 context->getProcAddress(QLatin1String("glIsFramebufferEXT"));
2685 if (!funcs->isFramebuffer) {
2686 funcs->isFramebuffer = (type_glIsFramebuffer)
2687 context->getProcAddress(QLatin1String("glIsFramebufferARB"));
2690 if (funcs->isFramebuffer)
2691 return funcs->isFramebuffer(framebuffer);
2692 funcs->isFramebuffer = qglfResolveIsFramebuffer;
2693 return GLboolean(0);
2696 static GLboolean QGLF_APIENTRY qglfSpecialIsProgram(GLuint program)
2698 return program != 0;
2701 static GLboolean QGLF_APIENTRY qglfResolveIsProgram(GLuint program)
2703 typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program);
2705 const QGLContext *context = QGLContext::currentContext();
2706 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2708 funcs->isProgram = (type_glIsProgram)
2709 context->getProcAddress(QLatin1String("glIsProgram"));
2710 if (!funcs->isProgram) {
2711 funcs->isProgram = (type_glIsProgram)
2712 context->getProcAddress(QLatin1String("glIsProgramARB"));
2715 if (!funcs->isProgram)
2716 funcs->isProgram = qglfSpecialIsProgram;
2718 return funcs->isProgram(program);
2721 static GLboolean QGLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer)
2723 typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
2725 const QGLContext *context = QGLContext::currentContext();
2726 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2728 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2729 context->getProcAddress(QLatin1String("glIsRenderbuffer"));
2731 if (!funcs->isRenderbuffer) {
2732 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2733 context->getProcAddress(QLatin1String("glIsRenderbufferOES"));
2736 if (!funcs->isRenderbuffer) {
2737 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2738 context->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
2740 if (!funcs->isRenderbuffer) {
2741 funcs->isRenderbuffer = (type_glIsRenderbuffer)
2742 context->getProcAddress(QLatin1String("glIsRenderbufferARB"));
2745 if (funcs->isRenderbuffer)
2746 return funcs->isRenderbuffer(renderbuffer);
2747 funcs->isRenderbuffer = qglfResolveIsRenderbuffer;
2748 return GLboolean(0);
2751 static GLboolean QGLF_APIENTRY qglfSpecialIsShader(GLuint shader)
2756 static GLboolean QGLF_APIENTRY qglfResolveIsShader(GLuint shader)
2758 typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader);
2760 const QGLContext *context = QGLContext::currentContext();
2761 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2763 funcs->isShader = (type_glIsShader)
2764 context->getProcAddress(QLatin1String("glIsShader"));
2765 if (!funcs->isShader) {
2766 funcs->isShader = (type_glIsShader)
2767 context->getProcAddress(QLatin1String("glIsShaderARB"));
2770 if (!funcs->isShader)
2771 funcs->isShader = qglfSpecialIsShader;
2773 return funcs->isShader(shader);
2776 static void QGLF_APIENTRY qglfResolveLinkProgram(GLuint program)
2778 typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
2780 const QGLContext *context = QGLContext::currentContext();
2781 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2783 funcs->linkProgram = (type_glLinkProgram)
2784 context->getProcAddress(QLatin1String("glLinkProgram"));
2785 if (!funcs->linkProgram) {
2786 funcs->linkProgram = (type_glLinkProgram)
2787 context->getProcAddress(QLatin1String("glLinkProgramARB"));
2790 if (funcs->linkProgram)
2791 funcs->linkProgram(program);
2793 funcs->linkProgram = qglfResolveLinkProgram;
2796 static void QGLF_APIENTRY qglfSpecialReleaseShaderCompiler()
2800 static void QGLF_APIENTRY qglfResolveReleaseShaderCompiler()
2802 typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)();
2804 const QGLContext *context = QGLContext::currentContext();
2805 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2807 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2808 context->getProcAddress(QLatin1String("glReleaseShaderCompiler"));
2809 if (!funcs->releaseShaderCompiler) {
2810 funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2811 context->getProcAddress(QLatin1String("glReleaseShaderCompilerARB"));
2814 if (!funcs->releaseShaderCompiler)
2815 funcs->releaseShaderCompiler = qglfSpecialReleaseShaderCompiler;
2817 funcs->releaseShaderCompiler();
2820 static void QGLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2822 typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
2824 const QGLContext *context = QGLContext::currentContext();
2825 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2827 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2828 context->getProcAddress(QLatin1String("glRenderbufferStorage"));
2830 if (!funcs->renderbufferStorage) {
2831 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2832 context->getProcAddress(QLatin1String("glRenderbufferStorageOES"));
2835 if (!funcs->renderbufferStorage) {
2836 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2837 context->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
2839 if (!funcs->renderbufferStorage) {
2840 funcs->renderbufferStorage = (type_glRenderbufferStorage)
2841 context->getProcAddress(QLatin1String("glRenderbufferStorageARB"));
2844 if (funcs->renderbufferStorage)
2845 funcs->renderbufferStorage(target, internalformat, width, height);
2847 funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
2850 static void QGLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2852 typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
2854 const QGLContext *context = QGLContext::currentContext();
2855 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2857 funcs->sampleCoverage = (type_glSampleCoverage)
2858 context->getProcAddress(QLatin1String("glSampleCoverage"));
2860 if (!funcs->sampleCoverage) {
2861 funcs->sampleCoverage = (type_glSampleCoverage)
2862 context->getProcAddress(QLatin1String("glSampleCoverageOES"));
2865 if (!funcs->sampleCoverage) {
2866 funcs->sampleCoverage = (type_glSampleCoverage)
2867 context->getProcAddress(QLatin1String("glSampleCoverageEXT"));
2869 if (!funcs->sampleCoverage) {
2870 funcs->sampleCoverage = (type_glSampleCoverage)
2871 context->getProcAddress(QLatin1String("glSampleCoverageARB"));
2874 if (funcs->sampleCoverage)
2875 funcs->sampleCoverage(value, invert);
2877 funcs->sampleCoverage = qglfResolveSampleCoverage;
2880 static void QGLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2882 typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
2884 const QGLContext *context = QGLContext::currentContext();
2885 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2887 funcs->shaderBinary = (type_glShaderBinary)
2888 context->getProcAddress(QLatin1String("glShaderBinary"));
2889 if (!funcs->shaderBinary) {
2890 funcs->shaderBinary = (type_glShaderBinary)
2891 context->getProcAddress(QLatin1String("glShaderBinaryARB"));
2894 if (funcs->shaderBinary)
2895 funcs->shaderBinary(n, shaders, binaryformat, binary, length);
2897 funcs->shaderBinary = qglfResolveShaderBinary;
2900 static void QGLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2902 typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
2904 const QGLContext *context = QGLContext::currentContext();
2905 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2907 funcs->shaderSource = (type_glShaderSource)
2908 context->getProcAddress(QLatin1String("glShaderSource"));
2909 if (!funcs->shaderSource) {
2910 funcs->shaderSource = (type_glShaderSource)
2911 context->getProcAddress(QLatin1String("glShaderSourceARB"));
2914 if (funcs->shaderSource)
2915 funcs->shaderSource(shader, count, string, length);
2917 funcs->shaderSource = qglfResolveShaderSource;
2920 static void QGLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2922 typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
2924 const QGLContext *context = QGLContext::currentContext();
2925 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2927 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2928 context->getProcAddress(QLatin1String("glStencilFuncSeparate"));
2930 if (!funcs->stencilFuncSeparate) {
2931 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2932 context->getProcAddress(QLatin1String("glStencilFuncSeparateOES"));
2935 if (!funcs->stencilFuncSeparate) {
2936 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2937 context->getProcAddress(QLatin1String("glStencilFuncSeparateEXT"));
2939 if (!funcs->stencilFuncSeparate) {
2940 funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2941 context->getProcAddress(QLatin1String("glStencilFuncSeparateARB"));
2944 if (funcs->stencilFuncSeparate)
2945 funcs->stencilFuncSeparate(face, func, ref, mask);
2947 funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
2950 static void QGLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2952 typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
2954 const QGLContext *context = QGLContext::currentContext();
2955 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2957 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2958 context->getProcAddress(QLatin1String("glStencilMaskSeparate"));
2960 if (!funcs->stencilMaskSeparate) {
2961 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2962 context->getProcAddress(QLatin1String("glStencilMaskSeparateOES"));
2965 if (!funcs->stencilMaskSeparate) {
2966 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2967 context->getProcAddress(QLatin1String("glStencilMaskSeparateEXT"));
2969 if (!funcs->stencilMaskSeparate) {
2970 funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2971 context->getProcAddress(QLatin1String("glStencilMaskSeparateARB"));
2974 if (funcs->stencilMaskSeparate)
2975 funcs->stencilMaskSeparate(face, mask);
2977 funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
2980 static void QGLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2982 typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
2984 const QGLContext *context = QGLContext::currentContext();
2985 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2987 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2988 context->getProcAddress(QLatin1String("glStencilOpSeparate"));
2990 if (!funcs->stencilOpSeparate) {
2991 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2992 context->getProcAddress(QLatin1String("glStencilOpSeparateOES"));
2995 if (!funcs->stencilOpSeparate) {
2996 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2997 context->getProcAddress(QLatin1String("glStencilOpSeparateEXT"));
2999 if (!funcs->stencilOpSeparate) {
3000 funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3001 context->getProcAddress(QLatin1String("glStencilOpSeparateARB"));
3004 if (funcs->stencilOpSeparate)
3005 funcs->stencilOpSeparate(face, fail, zfail, zpass);
3007 funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
3010 static void QGLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x)
3012 typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
3014 const QGLContext *context = QGLContext::currentContext();
3015 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3017 funcs->uniform1f = (type_glUniform1f)
3018 context->getProcAddress(QLatin1String("glUniform1f"));
3019 if (!funcs->uniform1f) {
3020 funcs->uniform1f = (type_glUniform1f)
3021 context->getProcAddress(QLatin1String("glUniform1fARB"));
3024 if (funcs->uniform1f)
3025 funcs->uniform1f(location, x);
3027 funcs->uniform1f = qglfResolveUniform1f;
3030 static void QGLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
3032 typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
3034 const QGLContext *context = QGLContext::currentContext();
3035 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3037 funcs->uniform1fv = (type_glUniform1fv)
3038 context->getProcAddress(QLatin1String("glUniform1fv"));
3039 if (!funcs->uniform1fv) {
3040 funcs->uniform1fv = (type_glUniform1fv)
3041 context->getProcAddress(QLatin1String("glUniform1fvARB"));
3044 if (funcs->uniform1fv)
3045 funcs->uniform1fv(location, count, v);
3047 funcs->uniform1fv = qglfResolveUniform1fv;
3050 static void QGLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x)
3052 typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
3054 const QGLContext *context = QGLContext::currentContext();
3055 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3057 funcs->uniform1i = (type_glUniform1i)
3058 context->getProcAddress(QLatin1String("glUniform1i"));
3059 if (!funcs->uniform1i) {
3060 funcs->uniform1i = (type_glUniform1i)
3061 context->getProcAddress(QLatin1String("glUniform1iARB"));
3064 if (funcs->uniform1i)
3065 funcs->uniform1i(location, x);
3067 funcs->uniform1i = qglfResolveUniform1i;
3070 static void QGLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
3072 typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
3074 const QGLContext *context = QGLContext::currentContext();
3075 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3077 funcs->uniform1iv = (type_glUniform1iv)
3078 context->getProcAddress(QLatin1String("glUniform1iv"));
3079 if (!funcs->uniform1iv) {
3080 funcs->uniform1iv = (type_glUniform1iv)
3081 context->getProcAddress(QLatin1String("glUniform1ivARB"));
3084 if (funcs->uniform1iv)
3085 funcs->uniform1iv(location, count, v);
3087 funcs->uniform1iv = qglfResolveUniform1iv;
3090 static void QGLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
3092 typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
3094 const QGLContext *context = QGLContext::currentContext();
3095 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3097 funcs->uniform2f = (type_glUniform2f)
3098 context->getProcAddress(QLatin1String("glUniform2f"));
3099 if (!funcs->uniform2f) {
3100 funcs->uniform2f = (type_glUniform2f)
3101 context->getProcAddress(QLatin1String("glUniform2fARB"));
3104 if (funcs->uniform2f)
3105 funcs->uniform2f(location, x, y);
3107 funcs->uniform2f = qglfResolveUniform2f;
3110 static void QGLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
3112 typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
3114 const QGLContext *context = QGLContext::currentContext();
3115 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3117 funcs->uniform2fv = (type_glUniform2fv)
3118 context->getProcAddress(QLatin1String("glUniform2fv"));
3119 if (!funcs->uniform2fv) {
3120 funcs->uniform2fv = (type_glUniform2fv)
3121 context->getProcAddress(QLatin1String("glUniform2fvARB"));
3124 if (funcs->uniform2fv)
3125 funcs->uniform2fv(location, count, v);
3127 funcs->uniform2fv = qglfResolveUniform2fv;
3130 static void QGLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y)
3132 typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
3134 const QGLContext *context = QGLContext::currentContext();
3135 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3137 funcs->uniform2i = (type_glUniform2i)
3138 context->getProcAddress(QLatin1String("glUniform2i"));
3139 if (!funcs->uniform2i) {
3140 funcs->uniform2i = (type_glUniform2i)
3141 context->getProcAddress(QLatin1String("glUniform2iARB"));
3144 if (funcs->uniform2i)
3145 funcs->uniform2i(location, x, y);
3147 funcs->uniform2i = qglfResolveUniform2i;
3150 static void QGLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
3152 typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
3154 const QGLContext *context = QGLContext::currentContext();
3155 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3157 funcs->uniform2iv = (type_glUniform2iv)
3158 context->getProcAddress(QLatin1String("glUniform2iv"));
3159 if (!funcs->uniform2iv) {
3160 funcs->uniform2iv = (type_glUniform2iv)
3161 context->getProcAddress(QLatin1String("glUniform2ivARB"));
3164 if (funcs->uniform2iv)
3165 funcs->uniform2iv(location, count, v);
3167 funcs->uniform2iv = qglfResolveUniform2iv;
3170 static void QGLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
3172 typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
3174 const QGLContext *context = QGLContext::currentContext();
3175 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3177 funcs->uniform3f = (type_glUniform3f)
3178 context->getProcAddress(QLatin1String("glUniform3f"));
3179 if (!funcs->uniform3f) {
3180 funcs->uniform3f = (type_glUniform3f)
3181 context->getProcAddress(QLatin1String("glUniform3fARB"));
3184 if (funcs->uniform3f)
3185 funcs->uniform3f(location, x, y, z);
3187 funcs->uniform3f = qglfResolveUniform3f;
3190 static void QGLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
3192 typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
3194 const QGLContext *context = QGLContext::currentContext();
3195 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3197 funcs->uniform3fv = (type_glUniform3fv)
3198 context->getProcAddress(QLatin1String("glUniform3fv"));
3199 if (!funcs->uniform3fv) {
3200 funcs->uniform3fv = (type_glUniform3fv)
3201 context->getProcAddress(QLatin1String("glUniform3fvARB"));
3204 if (funcs->uniform3fv)
3205 funcs->uniform3fv(location, count, v);
3207 funcs->uniform3fv = qglfResolveUniform3fv;
3210 static void QGLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
3212 typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
3214 const QGLContext *context = QGLContext::currentContext();
3215 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3217 funcs->uniform3i = (type_glUniform3i)
3218 context->getProcAddress(QLatin1String("glUniform3i"));
3219 if (!funcs->uniform3i) {
3220 funcs->uniform3i = (type_glUniform3i)
3221 context->getProcAddress(QLatin1String("glUniform3iARB"));
3224 if (funcs->uniform3i)
3225 funcs->uniform3i(location, x, y, z);
3227 funcs->uniform3i = qglfResolveUniform3i;
3230 static void QGLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
3232 typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
3234 const QGLContext *context = QGLContext::currentContext();
3235 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3237 funcs->uniform3iv = (type_glUniform3iv)
3238 context->getProcAddress(QLatin1String("glUniform3iv"));
3239 if (!funcs->uniform3iv) {
3240 funcs->uniform3iv = (type_glUniform3iv)
3241 context->getProcAddress(QLatin1String("glUniform3ivARB"));
3244 if (funcs->uniform3iv)
3245 funcs->uniform3iv(location, count, v);
3247 funcs->uniform3iv = qglfResolveUniform3iv;
3250 static void QGLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3252 typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3254 const QGLContext *context = QGLContext::currentContext();
3255 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3257 funcs->uniform4f = (type_glUniform4f)
3258 context->getProcAddress(QLatin1String("glUniform4f"));
3259 if (!funcs->uniform4f) {
3260 funcs->uniform4f = (type_glUniform4f)
3261 context->getProcAddress(QLatin1String("glUniform4fARB"));
3264 if (funcs->uniform4f)
3265 funcs->uniform4f(location, x, y, z, w);
3267 funcs->uniform4f = qglfResolveUniform4f;
3270 static void QGLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
3272 typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
3274 const QGLContext *context = QGLContext::currentContext();
3275 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3277 funcs->uniform4fv = (type_glUniform4fv)
3278 context->getProcAddress(QLatin1String("glUniform4fv"));
3279 if (!funcs->uniform4fv) {
3280 funcs->uniform4fv = (type_glUniform4fv)
3281 context->getProcAddress(QLatin1String("glUniform4fvARB"));
3284 if (funcs->uniform4fv)
3285 funcs->uniform4fv(location, count, v);
3287 funcs->uniform4fv = qglfResolveUniform4fv;
3290 static void QGLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
3292 typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
3294 const QGLContext *context = QGLContext::currentContext();
3295 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3297 funcs->uniform4i = (type_glUniform4i)
3298 context->getProcAddress(QLatin1String("glUniform4i"));
3299 if (!funcs->uniform4i) {
3300 funcs->uniform4i = (type_glUniform4i)
3301 context->getProcAddress(QLatin1String("glUniform4iARB"));
3304 if (funcs->uniform4i)
3305 funcs->uniform4i(location, x, y, z, w);
3307 funcs->uniform4i = qglfResolveUniform4i;
3310 static void QGLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
3312 typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
3314 const QGLContext *context = QGLContext::currentContext();
3315 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3317 funcs->uniform4iv = (type_glUniform4iv)
3318 context->getProcAddress(QLatin1String("glUniform4iv"));
3319 if (!funcs->uniform4iv) {
3320 funcs->uniform4iv = (type_glUniform4iv)
3321 context->getProcAddress(QLatin1String("glUniform4ivARB"));
3324 if (funcs->uniform4iv)
3325 funcs->uniform4iv(location, count, v);
3327 funcs->uniform4iv = qglfResolveUniform4iv;
3330 static void QGLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3332 typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3334 const QGLContext *context = QGLContext::currentContext();
3335 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3337 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3338 context->getProcAddress(QLatin1String("glUniformMatrix2fv"));
3339 if (!funcs->uniformMatrix2fv) {
3340 funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3341 context->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
3344 if (funcs->uniformMatrix2fv)
3345 funcs->uniformMatrix2fv(location, count, transpose, value);
3347 funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3350 static void QGLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3352 typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3354 const QGLContext *context = QGLContext::currentContext();
3355 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3357 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3358 context->getProcAddress(QLatin1String("glUniformMatrix3fv"));
3359 if (!funcs->uniformMatrix3fv) {
3360 funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3361 context->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
3364 if (funcs->uniformMatrix3fv)
3365 funcs->uniformMatrix3fv(location, count, transpose, value);
3367 funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3370 static void QGLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3372 typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3374 const QGLContext *context = QGLContext::currentContext();
3375 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3377 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3378 context->getProcAddress(QLatin1String("glUniformMatrix4fv"));
3379 if (!funcs->uniformMatrix4fv) {
3380 funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3381 context->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
3384 if (funcs->uniformMatrix4fv)
3385 funcs->uniformMatrix4fv(location, count, transpose, value);
3387 funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3390 static void QGLF_APIENTRY qglfResolveUseProgram(GLuint program)
3392 typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program);
3394 const QGLContext *context = QGLContext::currentContext();
3395 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3397 funcs->useProgram = (type_glUseProgram)
3398 context->getProcAddress(QLatin1String("glUseProgram"));
3399 if (!funcs->useProgram) {
3400 funcs->useProgram = (type_glUseProgram)
3401 context->getProcAddress(QLatin1String("glUseProgramObjectARB"));
3404 if (funcs->useProgram)
3405 funcs->useProgram(program);
3407 funcs->useProgram = qglfResolveUseProgram;
3410 static void QGLF_APIENTRY qglfResolveValidateProgram(GLuint program)
3412 typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
3414 const QGLContext *context = QGLContext::currentContext();
3415 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3417 funcs->validateProgram = (type_glValidateProgram)
3418 context->getProcAddress(QLatin1String("glValidateProgram"));
3419 if (!funcs->validateProgram) {
3420 funcs->validateProgram = (type_glValidateProgram)
3421 context->getProcAddress(QLatin1String("glValidateProgramARB"));
3424 if (funcs->validateProgram)
3425 funcs->validateProgram(program);
3427 funcs->validateProgram = qglfResolveValidateProgram;
3430 static void QGLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
3432 typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
3434 const QGLContext *context = QGLContext::currentContext();
3435 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3437 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3438 context->getProcAddress(QLatin1String("glVertexAttrib1f"));
3439 if (!funcs->vertexAttrib1f) {
3440 funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3441 context->getProcAddress(QLatin1String("glVertexAttrib1fARB"));
3444 if (funcs->vertexAttrib1f)
3445 funcs->vertexAttrib1f(indx, x);
3447 funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
3450 static void QGLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
3452 typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
3454 const QGLContext *context = QGLContext::currentContext();
3455 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3457 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3458 context->getProcAddress(QLatin1String("glVertexAttrib1fv"));
3459 if (!funcs->vertexAttrib1fv) {
3460 funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3461 context->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
3464 if (funcs->vertexAttrib1fv)
3465 funcs->vertexAttrib1fv(indx, values);
3467 funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3470 static void QGLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
3472 typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
3474 const QGLContext *context = QGLContext::currentContext();
3475 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3477 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3478 context->getProcAddress(QLatin1String("glVertexAttrib2f"));
3479 if (!funcs->vertexAttrib2f) {
3480 funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3481 context->getProcAddress(QLatin1String("glVertexAttrib2fARB"));
3484 if (funcs->vertexAttrib2f)
3485 funcs->vertexAttrib2f(indx, x, y);
3487 funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
3490 static void QGLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
3492 typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
3494 const QGLContext *context = QGLContext::currentContext();
3495 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3497 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3498 context->getProcAddress(QLatin1String("glVertexAttrib2fv"));
3499 if (!funcs->vertexAttrib2fv) {
3500 funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3501 context->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
3504 if (funcs->vertexAttrib2fv)
3505 funcs->vertexAttrib2fv(indx, values);
3507 funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3510 static void QGLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
3512 typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
3514 const QGLContext *context = QGLContext::currentContext();
3515 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3517 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3518 context->getProcAddress(QLatin1String("glVertexAttrib3f"));
3519 if (!funcs->vertexAttrib3f) {
3520 funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3521 context->getProcAddress(QLatin1String("glVertexAttrib3fARB"));
3524 if (funcs->vertexAttrib3f)
3525 funcs->vertexAttrib3f(indx, x, y, z);
3527 funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
3530 static void QGLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
3532 typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
3534 const QGLContext *context = QGLContext::currentContext();
3535 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3537 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3538 context->getProcAddress(QLatin1String("glVertexAttrib3fv"));
3539 if (!funcs->vertexAttrib3fv) {
3540 funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3541 context->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
3544 if (funcs->vertexAttrib3fv)
3545 funcs->vertexAttrib3fv(indx, values);
3547 funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3550 static void QGLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3552 typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3554 const QGLContext *context = QGLContext::currentContext();
3555 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3557 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3558 context->getProcAddress(QLatin1String("glVertexAttrib4f"));
3559 if (!funcs->vertexAttrib4f) {
3560 funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3561 context->getProcAddress(QLatin1String("glVertexAttrib4fARB"));
3564 if (funcs->vertexAttrib4f)
3565 funcs->vertexAttrib4f(indx, x, y, z, w);
3567 funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
3570 static void QGLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
3572 typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
3574 const QGLContext *context = QGLContext::currentContext();
3575 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3577 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3578 context->getProcAddress(QLatin1String("glVertexAttrib4fv"));
3579 if (!funcs->vertexAttrib4fv) {
3580 funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3581 context->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
3584 if (funcs->vertexAttrib4fv)
3585 funcs->vertexAttrib4fv(indx, values);
3587 funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3590 static void QGLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
3592 typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
3594 const QGLContext *context = QGLContext::currentContext();
3595 QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3597 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3598 context->getProcAddress(QLatin1String("glVertexAttribPointer"));
3599 if (!funcs->vertexAttribPointer) {
3600 funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3601 context->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
3604 if (funcs->vertexAttribPointer)
3605 funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
3607 funcs->vertexAttribPointer = qglfResolveVertexAttribPointer;
3610 #endif // !QT_OPENGL_ES_2
3612 QGLFunctionsPrivate::QGLFunctionsPrivate(const QGLContext *)
3614 #ifndef QT_OPENGL_ES_2
3615 activeTexture = qglfResolveActiveTexture;
3616 attachShader = qglfResolveAttachShader;
3617 bindAttribLocation = qglfResolveBindAttribLocation;
3618 bindBuffer = qglfResolveBindBuffer;
3619 bindFramebuffer = qglfResolveBindFramebuffer;
3620 bindRenderbuffer = qglfResolveBindRenderbuffer;
3621 blendColor = qglfResolveBlendColor;
3622 blendEquation = qglfResolveBlendEquation;
3623 blendEquationSeparate = qglfResolveBlendEquationSeparate;
3624 blendFuncSeparate = qglfResolveBlendFuncSeparate;
3625 bufferData = qglfResolveBufferData;
3626 bufferSubData = qglfResolveBufferSubData;
3627 checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
3628 compileShader = qglfResolveCompileShader;
3629 compressedTexImage2D = qglfResolveCompressedTexImage2D;
3630 compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
3631 createProgram = qglfResolveCreateProgram;
3632 createShader = qglfResolveCreateShader;
3633 deleteBuffers = qglfResolveDeleteBuffers;
3634 deleteFramebuffers = qglfResolveDeleteFramebuffers;
3635 deleteProgram = qglfResolveDeleteProgram;
3636 deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
3637 deleteShader = qglfResolveDeleteShader;
3638 detachShader = qglfResolveDetachShader;
3639 disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
3640 enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
3641 framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
3642 framebufferTexture2D = qglfResolveFramebufferTexture2D;
3643 genBuffers = qglfResolveGenBuffers;
3644 generateMipmap = qglfResolveGenerateMipmap;
3645 genFramebuffers = qglfResolveGenFramebuffers;
3646 genRenderbuffers = qglfResolveGenRenderbuffers;
3647 getActiveAttrib = qglfResolveGetActiveAttrib;
3648 getActiveUniform = qglfResolveGetActiveUniform;
3649 getAttachedShaders = qglfResolveGetAttachedShaders;
3650 getAttribLocation = qglfResolveGetAttribLocation;
3651 getBufferParameteriv = qglfResolveGetBufferParameteriv;
3652 getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
3653 getProgramiv = qglfResolveGetProgramiv;
3654 getProgramInfoLog = qglfResolveGetProgramInfoLog;
3655 getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
3656 getShaderiv = qglfResolveGetShaderiv;
3657 getShaderInfoLog = qglfResolveGetShaderInfoLog;
3658 getShaderPrecisionFormat = qglfResolveGetShaderPrecisionFormat;
3659 getShaderSource = qglfResolveGetShaderSource;
3660 getUniformfv = qglfResolveGetUniformfv;
3661 getUniformiv = qglfResolveGetUniformiv;
3662 getUniformLocation = qglfResolveGetUniformLocation;
3663 getVertexAttribfv = qglfResolveGetVertexAttribfv;
3664 getVertexAttribiv = qglfResolveGetVertexAttribiv;
3665 getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
3666 isBuffer = qglfResolveIsBuffer;
3667 isFramebuffer = qglfResolveIsFramebuffer;
3668 isProgram = qglfResolveIsProgram;
3669 isRenderbuffer = qglfResolveIsRenderbuffer;
3670 isShader = qglfResolveIsShader;
3671 linkProgram = qglfResolveLinkProgram;
3672 releaseShaderCompiler = qglfResolveReleaseShaderCompiler;
3673 renderbufferStorage = qglfResolveRenderbufferStorage;
3674 sampleCoverage = qglfResolveSampleCoverage;
3675 shaderBinary = qglfResolveShaderBinary;
3676 shaderSource = qglfResolveShaderSource;
3677 stencilFuncSeparate = qglfResolveStencilFuncSeparate;
3678 stencilMaskSeparate = qglfResolveStencilMaskSeparate;
3679 stencilOpSeparate = qglfResolveStencilOpSeparate;
3680 uniform1f = qglfResolveUniform1f;
3681 uniform1fv = qglfResolveUniform1fv;
3682 uniform1i = qglfResolveUniform1i;
3683 uniform1iv = qglfResolveUniform1iv;
3684 uniform2f = qglfResolveUniform2f;
3685 uniform2fv = qglfResolveUniform2fv;
3686 uniform2i = qglfResolveUniform2i;
3687 uniform2iv = qglfResolveUniform2iv;
3688 uniform3f = qglfResolveUniform3f;
3689 uniform3fv = qglfResolveUniform3fv;
3690 uniform3i = qglfResolveUniform3i;
3691 uniform3iv = qglfResolveUniform3iv;
3692 uniform4f = qglfResolveUniform4f;
3693 uniform4fv = qglfResolveUniform4fv;
3694 uniform4i = qglfResolveUniform4i;
3695 uniform4iv = qglfResolveUniform4iv;
3696 uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3697 uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3698 uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3699 useProgram = qglfResolveUseProgram;
3700 validateProgram = qglfResolveValidateProgram;
3701 vertexAttrib1f = qglfResolveVertexAttrib1f;
3702 vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3703 vertexAttrib2f = qglfResolveVertexAttrib2f;
3704 vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3705 vertexAttrib3f = qglfResolveVertexAttrib3f;
3706 vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3707 vertexAttrib4f = qglfResolveVertexAttrib4f;
3708 vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3709 vertexAttribPointer = qglfResolveVertexAttribPointer;
3710 #endif // !QT_OPENGL_ES_2