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 QtGui 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 "qopenglfunctions.h"
43 #include "qopenglextensions_p.h"
45 #include "QtGui/private/qopenglcontext_p.h"
46 #include "QtGui/private/qopengl_p.h"
51 \class QOpenGLFunctions
52 \brief The QOpenGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
57 OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
58 common across many desktop and embedded OpenGL implementations.
59 However, it can be difficult to use the functions from that subset
60 because they need to be resolved manually on desktop systems.
62 QOpenGLFunctions provides a guaranteed API that is available on all
63 OpenGL systems and takes care of function resolution on systems
64 that need it. The recommended way to use QOpenGLFunctions is by
68 class MyGLWindow : public QWindow, protected QOpenGLFunctions
72 MyGLWindow(QScreen *screen = 0);
78 QOpenGLContext *m_context;
81 MyGLWindow(QScreen *screen)
82 : QWindow(screen), QOpenGLWidget(parent)
84 setSurfaceType(OpenGLSurface);
87 // Create an OpenGL context
88 m_context = new QOpenGLContext;
91 // Setup scene and render it
96 void MyGLWindow::initializeGL()
98 m_context->makeCurrent(this);
99 initializeOpenGLFunctions();
103 The \c{paintGL()} function can then use any of the OpenGL/ES 2.0
104 functions without explicit resolution, such as glActiveTexture()
105 in the following example:
108 void MyGLWindow::paintGL()
110 m_context->makeCurrent(this);
111 glActiveTexture(GL_TEXTURE1);
112 glBindTexture(GL_TEXTURE_2D, textureId);
114 m_context->swapBuffers(this);
115 m_context->doneCurrent();
119 QOpenGLFunctions can also be used directly for ad-hoc invocation
120 of OpenGL/ES 2.0 functions on all platforms:
123 QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
124 glFuncs.glActiveTexture(GL_TEXTURE1);
127 QOpenGLFunctions provides wrappers for all OpenGL/ES 2.0 functions,
128 except those like \c{glDrawArrays()}, \c{glViewport()}, and
129 \c{glBindTexture()} that don't have portability issues.
131 The hasOpenGLFeature() and openGLFeatures() functions can be used
132 to determine if the OpenGL implementation has a major OpenGL/ES 2.0
133 feature. For example, the following checks if non power of two
134 textures are available:
137 QOpenGLFunctions funcs(QOpenGLContext::currentContext());
138 bool npot = funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
143 \enum QOpenGLFunctions::OpenGLFeature
144 This enum defines OpenGL/ES 2.0 features that may be optional
147 \value Multitexture glActiveTexture() function is available.
148 \value Shaders Shader functions are available.
149 \value Buffers Vertex and index buffer functions are available.
150 \value Framebuffers Framebuffer object functions are available.
151 \value BlendColor glBlendColor() is available.
152 \value BlendEquation glBlendEquation() is available.
153 \value BlendEquationSeparate glBlendEquationSeparate() is available.
154 \value BlendFuncSeparate glBlendFuncSeparate() is available.
155 \value BlendSubtract Blend subtract mode is available.
156 \value CompressedTextures Compressed texture functions are available.
157 \value Multisample glSampleCoverage() function is available.
158 \value StencilSeparate Separate stencil functions are available.
159 \value NPOTTextures Non power of two textures are available.
160 \value NPOTTextureRepeat Non power of two textures can use GL_REPEAT as wrap parameter.
163 // Hidden private fields for additional extension data.
164 struct QOpenGLFunctionsPrivateEx : public QOpenGLExtensionsPrivate, public QOpenGLSharedResource
166 QOpenGLFunctionsPrivateEx(QOpenGLContext *context)
167 : QOpenGLExtensionsPrivate(context)
168 , QOpenGLSharedResource(context->shareGroup())
173 void invalidateResource()
179 void freeResource(QOpenGLContext *)
181 // no gl resources to free
188 Q_GLOBAL_STATIC(QOpenGLMultiGroupSharedResource, qt_gl_functions_resource)
190 static QOpenGLFunctionsPrivateEx *qt_gl_functions(QOpenGLContext *context = 0)
193 context = QOpenGLContext::currentContext();
195 QOpenGLFunctionsPrivateEx *funcs =
196 qt_gl_functions_resource()->value<QOpenGLFunctionsPrivateEx>(context);
201 Constructs a default function resolver. The resolver cannot
202 be used until initializeOpenGLFunctions() is called to specify
205 \sa initializeOpenGLFunctions()
207 QOpenGLFunctions::QOpenGLFunctions()
213 Constructs a function resolver for \a context. If \a context
214 is null, then the resolver will be created for the current QOpenGLContext.
216 The context or another context in the group must be current.
218 An object constructed in this way can only be used with \a context
219 and other contexts that share with it. Use initializeOpenGLFunctions()
220 to change the object's context association.
222 \sa initializeOpenGLFunctions()
224 QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context)
227 if (context && QOpenGLContextGroup::currentContextGroup() == context->shareGroup())
228 d_ptr = qt_gl_functions(context);
230 qWarning() << "QOpenGLFunctions created with non-current context";
233 QOpenGLExtensions::QOpenGLExtensions()
238 QOpenGLExtensions::QOpenGLExtensions(QOpenGLContext *context)
239 : QOpenGLFunctions(context)
244 \fn QOpenGLFunctions::~QOpenGLFunctions()
246 Destroys this function resolver.
249 static int qt_gl_resolve_features()
251 #if defined(QT_OPENGL_ES_2)
252 int features = QOpenGLFunctions::Multitexture |
253 QOpenGLFunctions::Shaders |
254 QOpenGLFunctions::Buffers |
255 QOpenGLFunctions::Framebuffers |
256 QOpenGLFunctions::BlendColor |
257 QOpenGLFunctions::BlendEquation |
258 QOpenGLFunctions::BlendEquationSeparate |
259 QOpenGLFunctions::BlendFuncSeparate |
260 QOpenGLFunctions::BlendSubtract |
261 QOpenGLFunctions::CompressedTextures |
262 QOpenGLFunctions::Multisample |
263 QOpenGLFunctions::StencilSeparate;
264 QOpenGLExtensionMatcher extensions;
265 if (extensions.match("GL_IMG_texture_npot"))
266 features |= QOpenGLFunctions::NPOTTextures;
267 if (extensions.match("GL_OES_texture_npot"))
268 features |= QOpenGLFunctions::NPOTTextures |
269 QOpenGLFunctions::NPOTTextureRepeat;
271 #elif defined(QT_OPENGL_ES)
272 int features = QOpenGLFunctions::Multitexture |
273 QOpenGLFunctions::Buffers |
274 QOpenGLFunctions::CompressedTextures |
275 QOpenGLFunctions::Multisample;
276 QOpenGLExtensionMatcher extensions;
277 if (extensions.match("GL_OES_framebuffer_object"))
278 features |= QOpenGLFunctions::Framebuffers;
279 if (extensions.match("GL_OES_blend_equation_separate"))
280 features |= QOpenGLFunctions::BlendEquationSeparate;
281 if (extensions.match("GL_OES_blend_func_separate"))
282 features |= QOpenGLFunctions::BlendFuncSeparate;
283 if (extensions.match("GL_OES_blend_subtract"))
284 features |= QOpenGLFunctions::BlendSubtract;
285 if (extensions.match("GL_OES_texture_npot"))
286 features |= QOpenGLFunctions::NPOTTextures;
287 if (extensions.match("GL_IMG_texture_npot"))
288 features |= QOpenGLFunctions::NPOTTextures;
292 //QOpenGLFormat::OpenGLVersionFlags versions = QOpenGLFormat::openGLVersionFlags();
293 QOpenGLExtensionMatcher extensions;
295 // Recognize features by extension name.
296 if (extensions.match("GL_ARB_multitexture"))
297 features |= QOpenGLFunctions::Multitexture;
298 if (extensions.match("GL_ARB_shader_objects"))
299 features |= QOpenGLFunctions::Shaders;
300 if (extensions.match("GL_EXT_framebuffer_object") ||
301 extensions.match("GL_ARB_framebuffer_object"))
302 features |= QOpenGLFunctions::Framebuffers;
303 if (extensions.match("GL_EXT_blend_color"))
304 features |= QOpenGLFunctions::BlendColor;
305 if (extensions.match("GL_EXT_blend_equation_separate"))
306 features |= QOpenGLFunctions::BlendEquationSeparate;
307 if (extensions.match("GL_EXT_blend_func_separate"))
308 features |= QOpenGLFunctions::BlendFuncSeparate;
309 if (extensions.match("GL_EXT_blend_subtract"))
310 features |= QOpenGLFunctions::BlendSubtract;
311 if (extensions.match("GL_ARB_texture_compression"))
312 features |= QOpenGLFunctions::CompressedTextures;
313 if (extensions.match("GL_ARB_multisample"))
314 features |= QOpenGLFunctions::Multisample;
315 if (extensions.match("GL_ARB_texture_non_power_of_two"))
316 features |= QOpenGLFunctions::NPOTTextures;
318 // assume version 2.0 or higher
319 features |= QOpenGLFunctions::BlendColor |
320 QOpenGLFunctions::BlendEquation |
321 QOpenGLFunctions::Multitexture |
322 QOpenGLFunctions::CompressedTextures |
323 QOpenGLFunctions::Multisample |
324 QOpenGLFunctions::BlendFuncSeparate |
325 QOpenGLFunctions::Buffers |
326 QOpenGLFunctions::Shaders |
327 QOpenGLFunctions::StencilSeparate |
328 QOpenGLFunctions::BlendEquationSeparate |
329 QOpenGLFunctions::NPOTTextures;
334 static int qt_gl_resolve_extensions()
337 QOpenGLExtensionMatcher extensionMatcher;
338 #if defined(QT_OPENGL_ES)
339 if (extensionMatcher.match("GL_OES_mapbuffer"))
340 extensions |= QOpenGLExtensions::MapBuffer;
341 if (extensionMatcher.match("GL_OES_packed_depth_stencil"))
342 extensions |= QOpenGLExtensions::PackedDepthStencil;
343 if (extensionMatcher.match("GL_OES_element_index_uint"))
344 extensions |= QOpenGLExtensions::ElementIndexUint;
345 if (extensionMatcher.match("GL_OES_depth24"))
346 extensions |= QOpenGLExtensions::Depth24;
348 extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
350 // Recognize features by extension name.
351 if (extensionMatcher.match("GL_ARB_framebuffer_object")) {
352 extensions |= QOpenGLExtensions::FramebufferMultisample |
353 QOpenGLExtensions::FramebufferBlit |
354 QOpenGLExtensions::PackedDepthStencil;
356 if (extensionMatcher.match("GL_EXT_framebuffer_multisample"))
357 extensions |= QOpenGLExtensions::FramebufferMultisample;
358 if (extensionMatcher.match("GL_EXT_framebuffer_blit"))
359 extensions |= QOpenGLExtensions::FramebufferBlit;
360 if (extensionMatcher.match("GL_EXT_packed_depth_stencil"))
361 extensions |= QOpenGLExtensions::PackedDepthStencil;
368 Returns the set of features that are present on this system's
369 OpenGL implementation.
371 It is assumed that the QOpenGLContext associated with this function
374 \sa hasOpenGLFeature()
376 QOpenGLFunctions::OpenGLFeatures QOpenGLFunctions::openGLFeatures() const
378 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
381 if (d->m_features == -1)
382 d->m_features = qt_gl_resolve_features();
383 return QOpenGLFunctions::OpenGLFeatures(d->m_features);
387 Returns true if \a feature is present on this system's OpenGL
388 implementation; false otherwise.
390 It is assumed that the QOpenGLContext associated with this function
395 bool QOpenGLFunctions::hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const
397 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
400 if (d->m_features == -1)
401 d->m_features = qt_gl_resolve_features();
402 return (d->m_features & int(feature)) != 0;
406 Returns the set of extensions that are present on this system's
407 OpenGL implementation.
409 It is assumed that the QOpenGLContext associated with this extension
412 \sa hasOpenGLExtensions()
414 QOpenGLExtensions::OpenGLExtensions QOpenGLExtensions::openGLExtensions()
416 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
419 if (d->m_extensions == -1)
420 d->m_extensions = qt_gl_resolve_extensions();
421 return QOpenGLExtensions::OpenGLExtensions(d->m_extensions);
425 Returns true if \a extension is present on this system's OpenGL
426 implementation; false otherwise.
428 It is assumed that the QOpenGLContext associated with this extension
433 bool QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension extension) const
435 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
438 if (d->m_extensions == -1)
439 d->m_extensions = qt_gl_resolve_extensions();
440 return (d->m_extensions & int(extension)) != 0;
444 \fn void QOpenGLFunctions::initializeGLFunctions()
447 Use initializeOpenGLFunctions() instead.
451 Initializes OpenGL function resolution for the current context.
453 After calling this function, the QOpenGLFunctions object can only be
454 used with the current context and other contexts that share with it.
455 Call initializeOpenGLFunctions() again to change the object's context
458 void QOpenGLFunctions::initializeOpenGLFunctions()
460 d_ptr = qt_gl_functions();
464 \fn void QOpenGLFunctions::glActiveTexture(GLenum texture)
466 Convenience function that calls glActiveTexture(\a texture).
468 For more information, see the OpenGL/ES 2.0 documentation for
469 \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
473 \fn void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
475 Convenience function that calls glAttachShader(\a program, \a shader).
477 For more information, see the OpenGL/ES 2.0 documentation for
478 \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
480 This convenience function will do nothing on OpenGL/ES 1.x systems.
484 \fn void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
486 Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
488 For more information, see the OpenGL/ES 2.0 documentation for
489 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
491 This convenience function will do nothing on OpenGL/ES 1.x systems.
495 \fn void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
497 Convenience function that calls glBindBuffer(\a target, \a buffer).
499 For more information, see the OpenGL/ES 2.0 documentation for
500 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
504 \fn void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
506 Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
508 Note that Qt will translate a \a framebuffer argument of 0 to the currently
509 bound QOpenGLContext's defaultFramebufferObject().
511 For more information, see the OpenGL/ES 2.0 documentation for
512 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
516 \fn void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
518 Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
520 For more information, see the OpenGL/ES 2.0 documentation for
521 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
525 \fn void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
527 Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
529 For more information, see the OpenGL/ES 2.0 documentation for
530 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
534 \fn void QOpenGLFunctions::glBlendEquation(GLenum mode)
536 Convenience function that calls glBlendEquation(\a mode).
538 For more information, see the OpenGL/ES 2.0 documentation for
539 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
543 \fn void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
545 Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
547 For more information, see the OpenGL/ES 2.0 documentation for
548 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
552 \fn void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
554 Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
556 For more information, see the OpenGL/ES 2.0 documentation for
557 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
561 \fn void QOpenGLFunctions::glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
563 Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
565 For more information, see the OpenGL/ES 2.0 documentation for
566 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
570 \fn void QOpenGLFunctions::glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
572 Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
574 For more information, see the OpenGL/ES 2.0 documentation for
575 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
579 \fn GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
581 Convenience function that calls glCheckFramebufferStatus(\a target).
583 For more information, see the OpenGL/ES 2.0 documentation for
584 \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
588 \fn void QOpenGLFunctions::glClearDepthf(GLclampf depth)
590 Convenience function that calls glClearDepth(\a depth) on
591 desktop OpenGL systems and glClearDepthf(\a depth) on
592 embedded OpenGL/ES systems.
594 For more information, see the OpenGL/ES 2.0 documentation for
595 \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
599 \fn void QOpenGLFunctions::glCompileShader(GLuint shader)
601 Convenience function that calls glCompileShader(\a shader).
603 For more information, see the OpenGL/ES 2.0 documentation for
604 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
606 This convenience function will do nothing on OpenGL/ES 1.x systems.
610 \fn void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
612 Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
614 For more information, see the OpenGL/ES 2.0 documentation for
615 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
619 \fn void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
621 Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
623 For more information, see the OpenGL/ES 2.0 documentation for
624 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
628 \fn GLuint QOpenGLFunctions::glCreateProgram()
630 Convenience function that calls glCreateProgram().
632 For more information, see the OpenGL/ES 2.0 documentation for
633 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
635 This convenience function will do nothing on OpenGL/ES 1.x systems.
639 \fn GLuint QOpenGLFunctions::glCreateShader(GLenum type)
641 Convenience function that calls glCreateShader(\a type).
643 For more information, see the OpenGL/ES 2.0 documentation for
644 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
646 This convenience function will do nothing on OpenGL/ES 1.x systems.
650 \fn void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
652 Convenience function that calls glDeleteBuffers(\a n, \a buffers).
654 For more information, see the OpenGL/ES 2.0 documentation for
655 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
659 \fn void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
661 Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
663 For more information, see the OpenGL/ES 2.0 documentation for
664 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
668 \fn void QOpenGLFunctions::glDeleteProgram(GLuint program)
670 Convenience function that calls glDeleteProgram(\a program).
672 For more information, see the OpenGL/ES 2.0 documentation for
673 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
675 This convenience function will do nothing on OpenGL/ES 1.x systems.
679 \fn void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
681 Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
683 For more information, see the OpenGL/ES 2.0 documentation for
684 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
688 \fn void QOpenGLFunctions::glDeleteShader(GLuint shader)
690 Convenience function that calls glDeleteShader(\a shader).
692 For more information, see the OpenGL/ES 2.0 documentation for
693 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
695 This convenience function will do nothing on OpenGL/ES 1.x systems.
699 \fn void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
701 Convenience function that calls glDepthRange(\a zNear, \a zFar) on
702 desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
703 embedded OpenGL/ES systems.
705 For more information, see the OpenGL/ES 2.0 documentation for
706 \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
710 \fn void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
712 Convenience function that calls glDetachShader(\a program, \a shader).
714 For more information, see the OpenGL/ES 2.0 documentation for
715 \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
717 This convenience function will do nothing on OpenGL/ES 1.x systems.
721 \fn void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
723 Convenience function that calls glDisableVertexAttribArray(\a index).
725 For more information, see the OpenGL/ES 2.0 documentation for
726 \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
728 This convenience function will do nothing on OpenGL/ES 1.x systems.
732 \fn void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
734 Convenience function that calls glEnableVertexAttribArray(\a index).
736 For more information, see the OpenGL/ES 2.0 documentation for
737 \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
739 This convenience function will do nothing on OpenGL/ES 1.x systems.
743 \fn void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
745 Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
747 For more information, see the OpenGL/ES 2.0 documentation for
748 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
752 \fn void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
754 Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
756 For more information, see the OpenGL/ES 2.0 documentation for
757 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
761 \fn void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
763 Convenience function that calls glGenBuffers(\a n, \a buffers).
765 For more information, see the OpenGL/ES 2.0 documentation for
766 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
770 \fn void QOpenGLFunctions::glGenerateMipmap(GLenum target)
772 Convenience function that calls glGenerateMipmap(\a target).
774 For more information, see the OpenGL/ES 2.0 documentation for
775 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
779 \fn void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
781 Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
783 For more information, see the OpenGL/ES 2.0 documentation for
784 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
788 \fn void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
790 Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
792 For more information, see the OpenGL/ES 2.0 documentation for
793 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
797 \fn void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
799 Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
801 For more information, see the OpenGL/ES 2.0 documentation for
802 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
804 This convenience function will do nothing on OpenGL/ES 1.x systems.
808 \fn void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
810 Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
812 For more information, see the OpenGL/ES 2.0 documentation for
813 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
815 This convenience function will do nothing on OpenGL/ES 1.x systems.
819 \fn void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
821 Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
823 For more information, see the OpenGL/ES 2.0 documentation for
824 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
826 This convenience function will do nothing on OpenGL/ES 1.x systems.
830 \fn GLint QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
832 Convenience function that calls glGetAttribLocation(\a program, \a name).
834 For more information, see the OpenGL/ES 2.0 documentation for
835 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
837 This convenience function will do nothing on OpenGL/ES 1.x systems.
841 \fn void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
843 Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
845 For more information, see the OpenGL/ES 2.0 documentation for
846 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
850 \fn void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
852 Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
854 For more information, see the OpenGL/ES 2.0 documentation for
855 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
859 \fn void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
861 Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
863 For more information, see the OpenGL/ES 2.0 documentation for
864 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
866 This convenience function will do nothing on OpenGL/ES 1.x systems.
870 \fn void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
872 Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
874 For more information, see the OpenGL/ES 2.0 documentation for
875 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
877 This convenience function will do nothing on OpenGL/ES 1.x systems.
881 \fn void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
883 Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
885 For more information, see the OpenGL/ES 2.0 documentation for
886 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
890 \fn void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
892 Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
894 For more information, see the OpenGL/ES 2.0 documentation for
895 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
897 This convenience function will do nothing on OpenGL/ES 1.x systems.
901 \fn void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
903 Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
905 For more information, see the OpenGL/ES 2.0 documentation for
906 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
908 This convenience function will do nothing on OpenGL/ES 1.x systems.
912 \fn void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
914 Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
916 For more information, see the OpenGL/ES 2.0 documentation for
917 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
919 This convenience function will do nothing on OpenGL/ES 1.x systems.
923 \fn void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
925 Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
927 For more information, see the OpenGL/ES 2.0 documentation for
928 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
930 This convenience function will do nothing on OpenGL/ES 1.x systems.
934 \fn void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
936 Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
938 For more information, see the OpenGL/ES 2.0 documentation for
939 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
941 This convenience function will do nothing on OpenGL/ES 1.x systems.
945 \fn void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
947 Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
949 For more information, see the OpenGL/ES 2.0 documentation for
950 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
952 This convenience function will do nothing on OpenGL/ES 1.x systems.
956 \fn GLint QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
958 Convenience function that calls glGetUniformLocation(\a program, \a name).
960 For more information, see the OpenGL/ES 2.0 documentation for
961 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
963 This convenience function will do nothing on OpenGL/ES 1.x systems.
967 \fn void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
969 Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
971 For more information, see the OpenGL/ES 2.0 documentation for
972 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
974 This convenience function will do nothing on OpenGL/ES 1.x systems.
978 \fn void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
980 Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
982 For more information, see the OpenGL/ES 2.0 documentation for
983 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
985 This convenience function will do nothing on OpenGL/ES 1.x systems.
989 \fn void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
991 Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
993 For more information, see the OpenGL/ES 2.0 documentation for
994 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
996 This convenience function will do nothing on OpenGL/ES 1.x systems.
1000 \fn GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
1002 Convenience function that calls glIsBuffer(\a buffer).
1004 For more information, see the OpenGL/ES 2.0 documentation for
1005 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
1009 \fn GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
1011 Convenience function that calls glIsFramebuffer(\a framebuffer).
1013 For more information, see the OpenGL/ES 2.0 documentation for
1014 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
1018 \fn GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
1020 Convenience function that calls glIsProgram(\a program).
1022 For more information, see the OpenGL/ES 2.0 documentation for
1023 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
1025 This convenience function will do nothing on OpenGL/ES 1.x systems.
1029 \fn GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
1031 Convenience function that calls glIsRenderbuffer(\a renderbuffer).
1033 For more information, see the OpenGL/ES 2.0 documentation for
1034 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
1038 \fn GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
1040 Convenience function that calls glIsShader(\a shader).
1042 For more information, see the OpenGL/ES 2.0 documentation for
1043 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
1045 This convenience function will do nothing on OpenGL/ES 1.x systems.
1049 \fn void QOpenGLFunctions::glLinkProgram(GLuint program)
1051 Convenience function that calls glLinkProgram(\a program).
1053 For more information, see the OpenGL/ES 2.0 documentation for
1054 \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
1056 This convenience function will do nothing on OpenGL/ES 1.x systems.
1060 \fn void QOpenGLFunctions::glReleaseShaderCompiler()
1062 Convenience function that calls glReleaseShaderCompiler().
1064 For more information, see the OpenGL/ES 2.0 documentation for
1065 \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
1067 This convenience function will do nothing on OpenGL/ES 1.x systems.
1071 \fn void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1073 Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
1075 For more information, see the OpenGL/ES 2.0 documentation for
1076 \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
1080 \fn void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
1082 Convenience function that calls glSampleCoverage(\a value, \a invert).
1084 For more information, see the OpenGL/ES 2.0 documentation for
1085 \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
1089 \fn void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
1091 Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
1093 For more information, see the OpenGL/ES 2.0 documentation for
1094 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
1096 This convenience function will do nothing on OpenGL/ES 1.x systems.
1100 \fn void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
1102 Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
1104 For more information, see the OpenGL/ES 2.0 documentation for
1105 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
1107 This convenience function will do nothing on OpenGL/ES 1.x systems.
1111 \fn void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1113 Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1115 For more information, see the OpenGL/ES 2.0 documentation for
1116 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1120 \fn void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1122 Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1124 For more information, see the OpenGL/ES 2.0 documentation for
1125 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1129 \fn void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1131 Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1133 For more information, see the OpenGL/ES 2.0 documentation for
1134 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1138 \fn void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
1140 Convenience function that calls glUniform1f(\a location, \a x).
1142 For more information, see the OpenGL/ES 2.0 documentation for
1143 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1145 This convenience function will do nothing on OpenGL/ES 1.x systems.
1149 \fn void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1151 Convenience function that calls glUniform1fv(\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/glUniform1fv.xml}{glUniform1fv()}.
1156 This convenience function will do nothing on OpenGL/ES 1.x systems.
1160 \fn void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
1162 Convenience function that calls glUniform1i(\a location, \a x).
1164 For more information, see the OpenGL/ES 2.0 documentation for
1165 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1167 This convenience function will do nothing on OpenGL/ES 1.x systems.
1171 \fn void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1173 Convenience function that calls glUniform1iv(\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/glUniform1iv.xml}{glUniform1iv()}.
1178 This convenience function will do nothing on OpenGL/ES 1.x systems.
1182 \fn void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1184 Convenience function that calls glUniform2f(\a location, \a x, \a y).
1186 For more information, see the OpenGL/ES 2.0 documentation for
1187 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1189 This convenience function will do nothing on OpenGL/ES 1.x systems.
1193 \fn void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1195 Convenience function that calls glUniform2fv(\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/glUniform2fv.xml}{glUniform2fv()}.
1200 This convenience function will do nothing on OpenGL/ES 1.x systems.
1204 \fn void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1206 Convenience function that calls glUniform2i(\a location, \a x, \a y).
1208 For more information, see the OpenGL/ES 2.0 documentation for
1209 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1211 This convenience function will do nothing on OpenGL/ES 1.x systems.
1215 \fn void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1217 Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1219 For more information, see the OpenGL/ES 2.0 documentation for
1220 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1222 This convenience function will do nothing on OpenGL/ES 1.x systems.
1226 \fn void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1228 Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1230 For more information, see the OpenGL/ES 2.0 documentation for
1231 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1233 This convenience function will do nothing on OpenGL/ES 1.x systems.
1237 \fn void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1239 Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1241 For more information, see the OpenGL/ES 2.0 documentation for
1242 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1244 This convenience function will do nothing on OpenGL/ES 1.x systems.
1248 \fn void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1250 Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1252 For more information, see the OpenGL/ES 2.0 documentation for
1253 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1255 This convenience function will do nothing on OpenGL/ES 1.x systems.
1259 \fn void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1261 Convenience function that calls glUniform3iv(\a location, \a count, \a v).
1263 For more information, see the OpenGL/ES 2.0 documentation for
1264 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
1266 This convenience function will do nothing on OpenGL/ES 1.x systems.
1270 \fn void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1272 Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1274 For more information, see the OpenGL/ES 2.0 documentation for
1275 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1277 This convenience function will do nothing on OpenGL/ES 1.x systems.
1281 \fn void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1283 Convenience function that calls glUniform4fv(\a location, \a count, \a v).
1285 For more information, see the OpenGL/ES 2.0 documentation for
1286 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
1288 This convenience function will do nothing on OpenGL/ES 1.x systems.
1292 \fn void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1294 Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1296 For more information, see the OpenGL/ES 2.0 documentation for
1297 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1299 This convenience function will do nothing on OpenGL/ES 1.x systems.
1303 \fn void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1305 Convenience function that calls glUniform4iv(\a location, \a count, \a v).
1307 For more information, see the OpenGL/ES 2.0 documentation for
1308 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
1310 This convenience function will do nothing on OpenGL/ES 1.x systems.
1314 \fn void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1316 Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1318 For more information, see the OpenGL/ES 2.0 documentation for
1319 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1321 This convenience function will do nothing on OpenGL/ES 1.x systems.
1325 \fn void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1327 Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1329 For more information, see the OpenGL/ES 2.0 documentation for
1330 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1332 This convenience function will do nothing on OpenGL/ES 1.x systems.
1336 \fn void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1338 Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1340 For more information, see the OpenGL/ES 2.0 documentation for
1341 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1343 This convenience function will do nothing on OpenGL/ES 1.x systems.
1347 \fn void QOpenGLFunctions::glUseProgram(GLuint program)
1349 Convenience function that calls glUseProgram(\a program).
1351 For more information, see the OpenGL/ES 2.0 documentation for
1352 \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1354 This convenience function will do nothing on OpenGL/ES 1.x systems.
1358 \fn void QOpenGLFunctions::glValidateProgram(GLuint program)
1360 Convenience function that calls glValidateProgram(\a program).
1362 For more information, see the OpenGL/ES 2.0 documentation for
1363 \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1365 This convenience function will do nothing on OpenGL/ES 1.x systems.
1369 \fn void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1371 Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1373 For more information, see the OpenGL/ES 2.0 documentation for
1374 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1376 This convenience function will do nothing on OpenGL/ES 1.x systems.
1380 \fn void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1382 Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1384 For more information, see the OpenGL/ES 2.0 documentation for
1385 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1387 This convenience function will do nothing on OpenGL/ES 1.x systems.
1391 \fn void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1393 Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1395 For more information, see the OpenGL/ES 2.0 documentation for
1396 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1398 This convenience function will do nothing on OpenGL/ES 1.x systems.
1402 \fn void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1404 Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1406 For more information, see the OpenGL/ES 2.0 documentation for
1407 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1409 This convenience function will do nothing on OpenGL/ES 1.x systems.
1413 \fn void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1415 Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1417 For more information, see the OpenGL/ES 2.0 documentation for
1418 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1420 This convenience function will do nothing on OpenGL/ES 1.x systems.
1424 \fn void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1426 Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1428 For more information, see the OpenGL/ES 2.0 documentation for
1429 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1431 This convenience function will do nothing on OpenGL/ES 1.x systems.
1435 \fn void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1437 Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1439 For more information, see the OpenGL/ES 2.0 documentation for
1440 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1442 This convenience function will do nothing on OpenGL/ES 1.x systems.
1446 \fn void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1448 Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1450 For more information, see the OpenGL/ES 2.0 documentation for
1451 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1453 This convenience function will do nothing on OpenGL/ES 1.x systems.
1457 \fn void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1459 Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1461 For more information, see the OpenGL/ES 2.0 documentation for
1462 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1464 This convenience function will do nothing on OpenGL/ES 1.x systems.
1468 \fn bool QOpenGLFunctions::isInitialized(const QOpenGLFunctionsPrivate *d)
1480 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1484 Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1485 : funcPointerName(func)
1486 , fallbackFuncPointer(fallback)
1488 , alternateFuncName(alternateName)
1492 ReturnType operator()();
1494 template <typename P1>
1495 ReturnType operator()(P1 p1);
1497 template <typename P1, typename P2>
1498 ReturnType operator()(P1 p1, P2 p2);
1500 template <typename P1, typename P2, typename P3>
1501 ReturnType operator()(P1 p1, P2 p2, P3 p3);
1503 template <typename P1, typename P2, typename P3, typename P4>
1504 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1506 template <typename P1, typename P2, typename P3, typename P4, typename P5>
1507 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1509 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1510 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1512 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1513 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1515 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1516 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1518 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1519 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1521 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1522 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1525 FuncType Base::*funcPointerName;
1526 FuncType fallbackFuncPointer;
1527 QByteArray funcName;
1528 QByteArray alternateFuncName;
1531 template <typename Base, typename FuncType, int Policy>
1532 class Resolver<Base, FuncType, Policy, void>
1535 Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1536 : funcPointerName(func)
1537 , fallbackFuncPointer(fallback)
1539 , alternateFuncName(alternateName)
1545 template <typename P1>
1546 void operator()(P1 p1);
1548 template <typename P1, typename P2>
1549 void operator()(P1 p1, P2 p2);
1551 template <typename P1, typename P2, typename P3>
1552 void operator()(P1 p1, P2 p2, P3 p3);
1554 template <typename P1, typename P2, typename P3, typename P4>
1555 void operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1557 template <typename P1, typename P2, typename P3, typename P4, typename P5>
1558 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1560 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1561 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1563 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1564 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1566 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1567 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1569 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1570 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1572 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1573 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1576 FuncType Base::*funcPointerName;
1577 FuncType fallbackFuncPointer;
1578 QByteArray funcName;
1579 QByteArray alternateFuncName;
1582 #define RESOLVER_COMMON \
1583 QOpenGLContext *context = QOpenGLContext::currentContext(); \
1584 Base *funcs = qt_gl_functions(context); \
1586 FuncType old = funcs->*funcPointerName; \
1588 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName); \
1590 if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1591 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "OES"); \
1593 if (!(funcs->*funcPointerName)) \
1594 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "ARB"); \
1596 if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1597 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "EXT"); \
1599 if (!alternateFuncName.isEmpty() && !(funcs->*funcPointerName)) { \
1600 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName); \
1602 if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1603 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "OES"); \
1605 if (!(funcs->*funcPointerName)) \
1606 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "ARB"); \
1608 if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1609 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "EXT"); \
1612 #define RESOLVER_COMMON_NON_VOID \
1615 if (!(funcs->*funcPointerName)) { \
1616 if (fallbackFuncPointer) { \
1617 funcs->*funcPointerName = fallbackFuncPointer; \
1619 funcs->*funcPointerName = old; \
1620 return ReturnType(); \
1624 #define RESOLVER_COMMON_VOID \
1627 if (!(funcs->*funcPointerName)) { \
1628 if (fallbackFuncPointer) { \
1629 funcs->*funcPointerName = fallbackFuncPointer; \
1631 funcs->*funcPointerName = old; \
1636 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1637 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()()
1639 RESOLVER_COMMON_NON_VOID
1641 return (funcs->*funcPointerName)();
1644 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1>
1645 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1)
1647 RESOLVER_COMMON_NON_VOID
1649 return (funcs->*funcPointerName)(p1);
1652 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2>
1653 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2)
1655 RESOLVER_COMMON_NON_VOID
1657 return (funcs->*funcPointerName)(p1, p2);
1660 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3>
1661 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3)
1663 RESOLVER_COMMON_NON_VOID
1665 return (funcs->*funcPointerName)(p1, p2, p3);
1668 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4>
1669 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1671 RESOLVER_COMMON_NON_VOID
1673 return (funcs->*funcPointerName)(p1, p2, p3, p4);
1676 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1677 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1679 RESOLVER_COMMON_NON_VOID
1681 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1684 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1685 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1687 RESOLVER_COMMON_NON_VOID
1689 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1692 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1693 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1695 RESOLVER_COMMON_NON_VOID
1697 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1700 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1701 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1703 RESOLVER_COMMON_NON_VOID
1705 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1708 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1709 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
1711 RESOLVER_COMMON_NON_VOID
1713 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1716 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1717 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
1719 RESOLVER_COMMON_NON_VOID
1721 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1724 template <typename Base, typename FuncType, int Policy>
1725 void Resolver<Base, FuncType, Policy, void>::operator()()
1727 RESOLVER_COMMON_VOID
1729 (funcs->*funcPointerName)();
1732 template <typename Base, typename FuncType, int Policy> template <typename P1>
1733 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1)
1735 RESOLVER_COMMON_VOID
1737 (funcs->*funcPointerName)(p1);
1740 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2>
1741 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2)
1743 RESOLVER_COMMON_VOID
1745 (funcs->*funcPointerName)(p1, p2);
1748 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3>
1749 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3)
1751 RESOLVER_COMMON_VOID
1753 (funcs->*funcPointerName)(p1, p2, p3);
1756 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4>
1757 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1759 RESOLVER_COMMON_VOID
1761 (funcs->*funcPointerName)(p1, p2, p3, p4);
1764 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1765 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1767 RESOLVER_COMMON_VOID
1769 (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1772 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1773 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1775 RESOLVER_COMMON_VOID
1777 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1780 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1781 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1783 RESOLVER_COMMON_VOID
1785 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1788 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1789 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1791 RESOLVER_COMMON_VOID
1793 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1796 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1797 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
1799 RESOLVER_COMMON_VOID
1801 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1804 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1805 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
1807 RESOLVER_COMMON_VOID
1809 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1812 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1813 Resolver<Base, FuncType, Policy, ReturnType> functionResolverWithFallback(FuncType Base::*func, FuncType fallback, const char *name, const char *alternate = 0)
1815 return Resolver<Base, FuncType, Policy, ReturnType>(func, fallback, name, alternate);
1818 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1819 Resolver<Base, FuncType, Policy, ReturnType> functionResolver(FuncType Base::*func, const char *name, const char *alternate = 0)
1821 return Resolver<Base, FuncType, Policy, ReturnType>(func, 0, name, alternate);
1826 #define RESOLVE_FUNC(RETURN_TYPE, POLICY, NAME) \
1827 return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1829 #define RESOLVE_FUNC_VOID(POLICY, NAME) \
1830 functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1832 #define RESOLVE_FUNC_SPECIAL(RETURN_TYPE, POLICY, NAME) \
1833 return functionResolverWithFallback<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1835 #define RESOLVE_FUNC_SPECIAL_VOID(POLICY, NAME) \
1836 functionResolverWithFallback<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1838 #define RESOLVE_FUNC_WITH_ALTERNATE(RETURN_TYPE, POLICY, NAME, ALTERNATE) \
1839 return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1841 #define RESOLVE_FUNC_VOID_WITH_ALTERNATE(POLICY, NAME, ALTERNATE) \
1842 functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1844 #ifndef QT_OPENGL_ES_2
1846 static void QOPENGLF_APIENTRY qopenglfResolveActiveTexture(GLenum texture)
1848 RESOLVE_FUNC_VOID(0, ActiveTexture)(texture);
1851 static void QOPENGLF_APIENTRY qopenglfResolveAttachShader(GLuint program, GLuint shader)
1853 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, AttachShader, AttachObject)(program, shader);
1856 static void QOPENGLF_APIENTRY qopenglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1858 RESOLVE_FUNC_VOID(0, BindAttribLocation)(program, index, name);
1861 static void QOPENGLF_APIENTRY qopenglfResolveBindBuffer(GLenum target, GLuint buffer)
1863 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindBuffer)(target, buffer);
1866 static void QOPENGLF_APIENTRY qopenglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1868 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindFramebuffer)(target, framebuffer);
1871 static void QOPENGLF_APIENTRY qopenglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1873 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindRenderbuffer)(target, renderbuffer);
1876 static void QOPENGLF_APIENTRY qopenglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1878 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendColor)(red, green, blue, alpha);
1881 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquation(GLenum mode)
1883 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquation)(mode);
1886 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1888 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquationSeparate)(modeRGB, modeAlpha);
1891 static void QOPENGLF_APIENTRY qopenglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1893 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha);
1896 static void QOPENGLF_APIENTRY qopenglfResolveBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
1898 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferData)(target, size, data, usage);
1901 static void QOPENGLF_APIENTRY qopenglfResolveBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
1903 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferSubData)(target, offset, size, data);
1906 static GLenum QOPENGLF_APIENTRY qopenglfResolveCheckFramebufferStatus(GLenum target)
1908 RESOLVE_FUNC(GLenum, ResolveOES | ResolveEXT, CheckFramebufferStatus)(target);
1911 static void QOPENGLF_APIENTRY qopenglfResolveCompileShader(GLuint shader)
1913 RESOLVE_FUNC_VOID(0, CompileShader)(shader);
1916 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1918 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexImage2D)(target, level, internalformat, width, height, border, imageSize, data);
1921 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1923 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1926 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateProgram()
1928 RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateProgram, CreateProgramObject)();
1931 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateShader(GLenum type)
1933 RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateShader, CreateShaderObject)(type);
1936 static void QOPENGLF_APIENTRY qopenglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1938 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteBuffers)(n, buffers);
1941 static void QOPENGLF_APIENTRY qopenglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1943 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteFramebuffers)(n, framebuffers);
1946 static void QOPENGLF_APIENTRY qopenglfResolveDeleteProgram(GLuint program)
1948 RESOLVE_FUNC_VOID(0, DeleteProgram)(program);
1951 static void QOPENGLF_APIENTRY qopenglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1953 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteRenderbuffers)(n, renderbuffers);
1956 static void QOPENGLF_APIENTRY qopenglfResolveDeleteShader(GLuint shader)
1958 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DeleteShader, DeleteObject)(shader);
1961 static void QOPENGLF_APIENTRY qopenglfResolveDetachShader(GLuint program, GLuint shader)
1963 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DetachShader, DetachObject)(program, shader);
1966 static void QOPENGLF_APIENTRY qopenglfResolveDisableVertexAttribArray(GLuint index)
1968 RESOLVE_FUNC_VOID(0, DisableVertexAttribArray)(index);
1971 static void QOPENGLF_APIENTRY qopenglfResolveEnableVertexAttribArray(GLuint index)
1973 RESOLVE_FUNC_VOID(0, EnableVertexAttribArray)(index);
1976 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1978 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferRenderbuffer)(target, attachment, renderbuffertarget, renderbuffer);
1981 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1983 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferTexture2D)(target, attachment, textarget, texture, level);
1986 static void QOPENGLF_APIENTRY qopenglfResolveGenBuffers(GLsizei n, GLuint* buffers)
1988 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenBuffers)(n, buffers);
1991 static void QOPENGLF_APIENTRY qopenglfResolveGenerateMipmap(GLenum target)
1993 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenerateMipmap)(target);
1996 static void QOPENGLF_APIENTRY qopenglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
1998 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenFramebuffers)(n, framebuffers);
2001 static void QOPENGLF_APIENTRY qopenglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2003 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenRenderbuffers)(n, renderbuffers);
2006 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2008 RESOLVE_FUNC_VOID(0, GetActiveAttrib)(program, index, bufsize, length, size, type, name);
2011 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2013 RESOLVE_FUNC_VOID(0, GetActiveUniform)(program, index, bufsize, length, size, type, name);
2016 static void QOPENGLF_APIENTRY qopenglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2018 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetAttachedShaders, GetAttachedObjects)(program, maxcount, count, shaders);
2021 static GLint QOPENGLF_APIENTRY qopenglfResolveGetAttribLocation(GLuint program, const char* name)
2023 RESOLVE_FUNC(GLint, 0, GetAttribLocation)(program, name);
2026 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2028 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetBufferParameteriv)(target, pname, params);
2031 static void QOPENGLF_APIENTRY qopenglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2033 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetFramebufferAttachmentParameteriv)(target, attachment, pname, params);
2036 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2038 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramiv, GetObjectParameteriv)(program, pname, params);
2041 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2043 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramInfoLog, GetInfoLog)(program, bufsize, length, infolog);
2046 static void QOPENGLF_APIENTRY qopenglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2048 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetRenderbufferParameteriv)(target, pname, params);
2051 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2053 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderiv, GetObjectParameteriv)(shader, pname, params);
2056 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2058 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderInfoLog, GetInfoLog)(shader, bufsize, length, infolog);
2061 static void QOPENGLF_APIENTRY qopenglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2063 Q_UNUSED(shadertype);
2064 Q_UNUSED(precisiontype);
2065 range[0] = range[1] = precision[0] = 0;
2068 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2070 RESOLVE_FUNC_SPECIAL_VOID(ResolveOES | ResolveEXT, GetShaderPrecisionFormat)(shadertype, precisiontype, range, precision);
2073 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2075 RESOLVE_FUNC_VOID(0, GetShaderSource)(shader, bufsize, length, source);
2078 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2080 RESOLVE_FUNC_VOID(0, GetUniformfv)(program, location, params);
2083 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2085 RESOLVE_FUNC_VOID(0, GetUniformiv)(program, location, params);
2088 static GLint QOPENGLF_APIENTRY qopenglfResolveGetUniformLocation(GLuint program, const char* name)
2090 RESOLVE_FUNC(GLint, 0, GetUniformLocation)(program, name);
2093 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2095 RESOLVE_FUNC_VOID(0, GetVertexAttribfv)(index, pname, params);
2098 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2100 RESOLVE_FUNC_VOID(0, GetVertexAttribiv)(index, pname, params);
2103 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2105 RESOLVE_FUNC_VOID(0, GetVertexAttribPointerv)(index, pname, pointer);
2108 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsBuffer(GLuint buffer)
2110 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsBuffer)(buffer);
2113 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsFramebuffer(GLuint framebuffer)
2115 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsFramebuffer)(framebuffer);
2118 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsProgram(GLuint program)
2120 return program != 0;
2123 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsProgram(GLuint program)
2125 RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsProgram)(program);
2128 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsRenderbuffer(GLuint renderbuffer)
2130 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsRenderbuffer)(renderbuffer);
2133 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsShader(GLuint shader)
2138 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsShader(GLuint shader)
2140 RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsShader)(shader);
2143 static void QOPENGLF_APIENTRY qopenglfResolveLinkProgram(GLuint program)
2145 RESOLVE_FUNC_VOID(0, LinkProgram)(program);
2148 static void QOPENGLF_APIENTRY qopenglfSpecialReleaseShaderCompiler()
2152 static void QOPENGLF_APIENTRY qopenglfResolveReleaseShaderCompiler()
2154 RESOLVE_FUNC_SPECIAL_VOID(0, ReleaseShaderCompiler)();
2157 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2159 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, RenderbufferStorage)(target, internalformat, width, height);
2162 static void QOPENGLF_APIENTRY qopenglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2164 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, SampleCoverage)(value, invert);
2167 static void QOPENGLF_APIENTRY qopenglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2169 RESOLVE_FUNC_VOID(0, ShaderBinary)(n, shaders, binaryformat, binary, length);
2172 static void QOPENGLF_APIENTRY qopenglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2174 RESOLVE_FUNC_VOID(0, ShaderSource)(shader, count, string, length);
2177 static void QOPENGLF_APIENTRY qopenglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2179 RESOLVE_FUNC_VOID(ResolveEXT, StencilFuncSeparate)(face, func, ref, mask);
2182 static void QOPENGLF_APIENTRY qopenglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2184 RESOLVE_FUNC_VOID(ResolveEXT, StencilMaskSeparate)(face, mask);
2187 static void QOPENGLF_APIENTRY qopenglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2189 RESOLVE_FUNC_VOID(ResolveEXT, StencilOpSeparate)(face, fail, zfail, zpass);
2192 static void QOPENGLF_APIENTRY qopenglfResolveUniform1f(GLint location, GLfloat x)
2194 RESOLVE_FUNC_VOID(0, Uniform1f)(location, x);
2197 static void QOPENGLF_APIENTRY qopenglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
2199 RESOLVE_FUNC_VOID(0, Uniform1fv)(location, count, v);
2202 static void QOPENGLF_APIENTRY qopenglfResolveUniform1i(GLint location, GLint x)
2204 RESOLVE_FUNC_VOID(0, Uniform1i)(location, x);
2207 static void QOPENGLF_APIENTRY qopenglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
2209 RESOLVE_FUNC_VOID(0, Uniform1iv)(location, count, v);
2212 static void QOPENGLF_APIENTRY qopenglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
2214 RESOLVE_FUNC_VOID(0, Uniform2f)(location, x, y);
2217 static void QOPENGLF_APIENTRY qopenglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
2219 RESOLVE_FUNC_VOID(0, Uniform2fv)(location, count, v);
2222 static void QOPENGLF_APIENTRY qopenglfResolveUniform2i(GLint location, GLint x, GLint y)
2224 RESOLVE_FUNC_VOID(0, Uniform2i)(location, x, y);
2227 static void QOPENGLF_APIENTRY qopenglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
2229 RESOLVE_FUNC_VOID(0, Uniform2iv)(location, count, v);
2232 static void QOPENGLF_APIENTRY qopenglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
2234 RESOLVE_FUNC_VOID(0, Uniform3f)(location, x, y, z);
2237 static void QOPENGLF_APIENTRY qopenglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
2239 RESOLVE_FUNC_VOID(0, Uniform3fv)(location, count, v);
2242 static void QOPENGLF_APIENTRY qopenglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
2244 RESOLVE_FUNC_VOID(0, Uniform3i)(location, x, y, z);
2247 static void QOPENGLF_APIENTRY qopenglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
2249 RESOLVE_FUNC_VOID(0, Uniform3iv)(location, count, v);
2252 static void QOPENGLF_APIENTRY qopenglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2254 RESOLVE_FUNC_VOID(0, Uniform4f)(location, x, y, z, w);
2257 static void QOPENGLF_APIENTRY qopenglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
2259 RESOLVE_FUNC_VOID(0, Uniform4fv)(location, count, v);
2262 static void QOPENGLF_APIENTRY qopenglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
2264 RESOLVE_FUNC_VOID(0, Uniform4i)(location, x, y, z, w);
2267 static void QOPENGLF_APIENTRY qopenglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
2269 RESOLVE_FUNC_VOID(0, Uniform4iv)(location, count, v);
2272 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2274 RESOLVE_FUNC_VOID(0, UniformMatrix2fv)(location, count, transpose, value);
2277 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2279 RESOLVE_FUNC_VOID(0, UniformMatrix3fv)(location, count, transpose, value);
2282 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2284 RESOLVE_FUNC_VOID(0, UniformMatrix4fv)(location, count, transpose, value);
2287 static void QOPENGLF_APIENTRY qopenglfResolveUseProgram(GLuint program)
2289 RESOLVE_FUNC_VOID(0, UseProgram)(program);
2292 static void QOPENGLF_APIENTRY qopenglfResolveValidateProgram(GLuint program)
2294 RESOLVE_FUNC_VOID(0, ValidateProgram)(program);
2297 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
2299 RESOLVE_FUNC_VOID(0, VertexAttrib1f)(indx, x);
2302 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
2304 RESOLVE_FUNC_VOID(0, VertexAttrib1fv)(indx, values);
2307 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
2309 RESOLVE_FUNC_VOID(0, VertexAttrib2f)(indx, x, y);
2312 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
2314 RESOLVE_FUNC_VOID(0, VertexAttrib2fv)(indx, values);
2317 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
2319 RESOLVE_FUNC_VOID(0, VertexAttrib3f)(indx, x, y, z);
2322 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
2324 RESOLVE_FUNC_VOID(0, VertexAttrib3fv)(indx, values);
2327 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2329 RESOLVE_FUNC_VOID(0, VertexAttrib4f)(indx, x, y, z, w);
2332 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
2334 RESOLVE_FUNC_VOID(0, VertexAttrib4fv)(indx, values);
2337 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
2339 RESOLVE_FUNC_VOID(0, VertexAttribPointer)(indx, size, type, normalized, stride, ptr);
2342 #endif // !QT_OPENGL_ES_2
2344 static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum access)
2346 RESOLVE_FUNC(GLvoid *, ResolveOES, MapBuffer)(target, access);
2349 static GLboolean QOPENGLF_APIENTRY qopenglfResolveUnmapBuffer(GLenum target)
2351 RESOLVE_FUNC(GLboolean, ResolveOES, UnmapBuffer)(target);
2354 static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
2355 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
2356 GLbitfield mask, GLenum filter)
2358 RESOLVE_FUNC_VOID(ResolveEXT, BlitFramebuffer)
2359 (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
2362 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples,
2363 GLenum internalFormat,
2364 GLsizei width, GLsizei height)
2366 RESOLVE_FUNC_VOID(ResolveEXT, RenderbufferStorageMultisample)
2367 (target, samples, internalFormat, width, height);
2370 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
2372 RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
2373 (target, offset, size, data);
2376 QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(QOpenGLContext *)
2378 /* Assign a pointer to an above defined static function
2379 * which on first call resolves the function from the current
2380 * context, assigns it to the member variable and executes it
2381 * (see Resolver template) */
2382 #ifndef QT_OPENGL_ES_2
2383 ActiveTexture = qopenglfResolveActiveTexture;
2384 AttachShader = qopenglfResolveAttachShader;
2385 BindAttribLocation = qopenglfResolveBindAttribLocation;
2386 BindBuffer = qopenglfResolveBindBuffer;
2387 BindFramebuffer = qopenglfResolveBindFramebuffer;
2388 BindRenderbuffer = qopenglfResolveBindRenderbuffer;
2389 BlendColor = qopenglfResolveBlendColor;
2390 BlendEquation = qopenglfResolveBlendEquation;
2391 BlendEquationSeparate = qopenglfResolveBlendEquationSeparate;
2392 BlendFuncSeparate = qopenglfResolveBlendFuncSeparate;
2393 BufferData = qopenglfResolveBufferData;
2394 BufferSubData = qopenglfResolveBufferSubData;
2395 CheckFramebufferStatus = qopenglfResolveCheckFramebufferStatus;
2396 CompileShader = qopenglfResolveCompileShader;
2397 CompressedTexImage2D = qopenglfResolveCompressedTexImage2D;
2398 CompressedTexSubImage2D = qopenglfResolveCompressedTexSubImage2D;
2399 CreateProgram = qopenglfResolveCreateProgram;
2400 CreateShader = qopenglfResolveCreateShader;
2401 DeleteBuffers = qopenglfResolveDeleteBuffers;
2402 DeleteFramebuffers = qopenglfResolveDeleteFramebuffers;
2403 DeleteProgram = qopenglfResolveDeleteProgram;
2404 DeleteRenderbuffers = qopenglfResolveDeleteRenderbuffers;
2405 DeleteShader = qopenglfResolveDeleteShader;
2406 DetachShader = qopenglfResolveDetachShader;
2407 DisableVertexAttribArray = qopenglfResolveDisableVertexAttribArray;
2408 EnableVertexAttribArray = qopenglfResolveEnableVertexAttribArray;
2409 FramebufferRenderbuffer = qopenglfResolveFramebufferRenderbuffer;
2410 FramebufferTexture2D = qopenglfResolveFramebufferTexture2D;
2411 GenBuffers = qopenglfResolveGenBuffers;
2412 GenerateMipmap = qopenglfResolveGenerateMipmap;
2413 GenFramebuffers = qopenglfResolveGenFramebuffers;
2414 GenRenderbuffers = qopenglfResolveGenRenderbuffers;
2415 GetActiveAttrib = qopenglfResolveGetActiveAttrib;
2416 GetActiveUniform = qopenglfResolveGetActiveUniform;
2417 GetAttachedShaders = qopenglfResolveGetAttachedShaders;
2418 GetAttribLocation = qopenglfResolveGetAttribLocation;
2419 GetBufferParameteriv = qopenglfResolveGetBufferParameteriv;
2420 GetFramebufferAttachmentParameteriv = qopenglfResolveGetFramebufferAttachmentParameteriv;
2421 GetProgramiv = qopenglfResolveGetProgramiv;
2422 GetProgramInfoLog = qopenglfResolveGetProgramInfoLog;
2423 GetRenderbufferParameteriv = qopenglfResolveGetRenderbufferParameteriv;
2424 GetShaderiv = qopenglfResolveGetShaderiv;
2425 GetShaderInfoLog = qopenglfResolveGetShaderInfoLog;
2426 GetShaderPrecisionFormat = qopenglfResolveGetShaderPrecisionFormat;
2427 GetShaderSource = qopenglfResolveGetShaderSource;
2428 GetUniformfv = qopenglfResolveGetUniformfv;
2429 GetUniformiv = qopenglfResolveGetUniformiv;
2430 GetUniformLocation = qopenglfResolveGetUniformLocation;
2431 GetVertexAttribfv = qopenglfResolveGetVertexAttribfv;
2432 GetVertexAttribiv = qopenglfResolveGetVertexAttribiv;
2433 GetVertexAttribPointerv = qopenglfResolveGetVertexAttribPointerv;
2434 IsBuffer = qopenglfResolveIsBuffer;
2435 IsFramebuffer = qopenglfResolveIsFramebuffer;
2436 IsProgram = qopenglfResolveIsProgram;
2437 IsRenderbuffer = qopenglfResolveIsRenderbuffer;
2438 IsShader = qopenglfResolveIsShader;
2439 LinkProgram = qopenglfResolveLinkProgram;
2440 ReleaseShaderCompiler = qopenglfResolveReleaseShaderCompiler;
2441 RenderbufferStorage = qopenglfResolveRenderbufferStorage;
2442 SampleCoverage = qopenglfResolveSampleCoverage;
2443 ShaderBinary = qopenglfResolveShaderBinary;
2444 ShaderSource = qopenglfResolveShaderSource;
2445 StencilFuncSeparate = qopenglfResolveStencilFuncSeparate;
2446 StencilMaskSeparate = qopenglfResolveStencilMaskSeparate;
2447 StencilOpSeparate = qopenglfResolveStencilOpSeparate;
2448 Uniform1f = qopenglfResolveUniform1f;
2449 Uniform1fv = qopenglfResolveUniform1fv;
2450 Uniform1i = qopenglfResolveUniform1i;
2451 Uniform1iv = qopenglfResolveUniform1iv;
2452 Uniform2f = qopenglfResolveUniform2f;
2453 Uniform2fv = qopenglfResolveUniform2fv;
2454 Uniform2i = qopenglfResolveUniform2i;
2455 Uniform2iv = qopenglfResolveUniform2iv;
2456 Uniform3f = qopenglfResolveUniform3f;
2457 Uniform3fv = qopenglfResolveUniform3fv;
2458 Uniform3i = qopenglfResolveUniform3i;
2459 Uniform3iv = qopenglfResolveUniform3iv;
2460 Uniform4f = qopenglfResolveUniform4f;
2461 Uniform4fv = qopenglfResolveUniform4fv;
2462 Uniform4i = qopenglfResolveUniform4i;
2463 Uniform4iv = qopenglfResolveUniform4iv;
2464 UniformMatrix2fv = qopenglfResolveUniformMatrix2fv;
2465 UniformMatrix3fv = qopenglfResolveUniformMatrix3fv;
2466 UniformMatrix4fv = qopenglfResolveUniformMatrix4fv;
2467 UseProgram = qopenglfResolveUseProgram;
2468 ValidateProgram = qopenglfResolveValidateProgram;
2469 VertexAttrib1f = qopenglfResolveVertexAttrib1f;
2470 VertexAttrib1fv = qopenglfResolveVertexAttrib1fv;
2471 VertexAttrib2f = qopenglfResolveVertexAttrib2f;
2472 VertexAttrib2fv = qopenglfResolveVertexAttrib2fv;
2473 VertexAttrib3f = qopenglfResolveVertexAttrib3f;
2474 VertexAttrib3fv = qopenglfResolveVertexAttrib3fv;
2475 VertexAttrib4f = qopenglfResolveVertexAttrib4f;
2476 VertexAttrib4fv = qopenglfResolveVertexAttrib4fv;
2477 VertexAttribPointer = qopenglfResolveVertexAttribPointer;
2478 #endif // !QT_OPENGL_ES_2
2481 QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
2482 : QOpenGLFunctionsPrivate(ctx)
2484 MapBuffer = qopenglfResolveMapBuffer;
2485 UnmapBuffer = qopenglfResolveUnmapBuffer;
2486 BlitFramebuffer = qopenglfResolveBlitFramebuffer;
2487 RenderbufferStorageMultisample = qopenglfResolveRenderbufferStorageMultisample;
2488 GetBufferSubData = qopenglfResolveGetBufferSubData;