1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtGui module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
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 if (extensionMatcher.match("GL_EXT_bgra"))
349 extensions |= QOpenGLExtensions::BGRATextureFormat;
352 extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
354 // Recognize features by extension name.
355 if (extensionMatcher.match("GL_ARB_framebuffer_object")) {
356 extensions |= QOpenGLExtensions::FramebufferMultisample |
357 QOpenGLExtensions::FramebufferBlit |
358 QOpenGLExtensions::PackedDepthStencil;
360 if (extensionMatcher.match("GL_EXT_framebuffer_multisample"))
361 extensions |= QOpenGLExtensions::FramebufferMultisample;
362 if (extensionMatcher.match("GL_EXT_framebuffer_blit"))
363 extensions |= QOpenGLExtensions::FramebufferBlit;
364 if (extensionMatcher.match("GL_EXT_packed_depth_stencil"))
365 extensions |= QOpenGLExtensions::PackedDepthStencil;
372 Returns the set of features that are present on this system's
373 OpenGL implementation.
375 It is assumed that the QOpenGLContext associated with this function
378 \sa hasOpenGLFeature()
380 QOpenGLFunctions::OpenGLFeatures QOpenGLFunctions::openGLFeatures() const
382 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
385 if (d->m_features == -1)
386 d->m_features = qt_gl_resolve_features();
387 return QOpenGLFunctions::OpenGLFeatures(d->m_features);
391 Returns true if \a feature is present on this system's OpenGL
392 implementation; false otherwise.
394 It is assumed that the QOpenGLContext associated with this function
399 bool QOpenGLFunctions::hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const
401 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
404 if (d->m_features == -1)
405 d->m_features = qt_gl_resolve_features();
406 return (d->m_features & int(feature)) != 0;
410 Returns the set of extensions that are present on this system's
411 OpenGL implementation.
413 It is assumed that the QOpenGLContext associated with this extension
416 \sa hasOpenGLExtensions()
418 QOpenGLExtensions::OpenGLExtensions QOpenGLExtensions::openGLExtensions()
420 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
423 if (d->m_extensions == -1)
424 d->m_extensions = qt_gl_resolve_extensions();
425 return QOpenGLExtensions::OpenGLExtensions(d->m_extensions);
429 Returns true if \a extension is present on this system's OpenGL
430 implementation; false otherwise.
432 It is assumed that the QOpenGLContext associated with this extension
437 bool QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension extension) const
439 QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
442 if (d->m_extensions == -1)
443 d->m_extensions = qt_gl_resolve_extensions();
444 return (d->m_extensions & int(extension)) != 0;
448 \fn void QOpenGLFunctions::initializeGLFunctions()
451 Use initializeOpenGLFunctions() instead.
455 Initializes OpenGL function resolution for the current context.
457 After calling this function, the QOpenGLFunctions object can only be
458 used with the current context and other contexts that share with it.
459 Call initializeOpenGLFunctions() again to change the object's context
462 void QOpenGLFunctions::initializeOpenGLFunctions()
464 d_ptr = qt_gl_functions();
468 \fn void QOpenGLFunctions::glActiveTexture(GLenum texture)
470 Convenience function that calls glActiveTexture(\a texture).
472 For more information, see the OpenGL/ES 2.0 documentation for
473 \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
477 \fn void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
479 Convenience function that calls glAttachShader(\a program, \a shader).
481 For more information, see the OpenGL/ES 2.0 documentation for
482 \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
484 This convenience function will do nothing on OpenGL/ES 1.x systems.
488 \fn void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
490 Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
492 For more information, see the OpenGL/ES 2.0 documentation for
493 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
495 This convenience function will do nothing on OpenGL/ES 1.x systems.
499 \fn void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
501 Convenience function that calls glBindBuffer(\a target, \a buffer).
503 For more information, see the OpenGL/ES 2.0 documentation for
504 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
508 \fn void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
510 Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
512 Note that Qt will translate a \a framebuffer argument of 0 to the currently
513 bound QOpenGLContext's defaultFramebufferObject().
515 For more information, see the OpenGL/ES 2.0 documentation for
516 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
520 \fn void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
522 Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
524 For more information, see the OpenGL/ES 2.0 documentation for
525 \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
529 \fn void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
531 Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
533 For more information, see the OpenGL/ES 2.0 documentation for
534 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
538 \fn void QOpenGLFunctions::glBlendEquation(GLenum mode)
540 Convenience function that calls glBlendEquation(\a mode).
542 For more information, see the OpenGL/ES 2.0 documentation for
543 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
547 \fn void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
549 Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
551 For more information, see the OpenGL/ES 2.0 documentation for
552 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
556 \fn void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
558 Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
560 For more information, see the OpenGL/ES 2.0 documentation for
561 \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
565 \fn void QOpenGLFunctions::glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
567 Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
569 For more information, see the OpenGL/ES 2.0 documentation for
570 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
574 \fn void QOpenGLFunctions::glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
576 Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
578 For more information, see the OpenGL/ES 2.0 documentation for
579 \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
583 \fn GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
585 Convenience function that calls glCheckFramebufferStatus(\a target).
587 For more information, see the OpenGL/ES 2.0 documentation for
588 \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
592 \fn void QOpenGLFunctions::glClearDepthf(GLclampf depth)
594 Convenience function that calls glClearDepth(\a depth) on
595 desktop OpenGL systems and glClearDepthf(\a depth) on
596 embedded OpenGL/ES systems.
598 For more information, see the OpenGL/ES 2.0 documentation for
599 \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
603 \fn void QOpenGLFunctions::glCompileShader(GLuint shader)
605 Convenience function that calls glCompileShader(\a shader).
607 For more information, see the OpenGL/ES 2.0 documentation for
608 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
610 This convenience function will do nothing on OpenGL/ES 1.x systems.
614 \fn void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
616 Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
618 For more information, see the OpenGL/ES 2.0 documentation for
619 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
623 \fn void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
625 Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
627 For more information, see the OpenGL/ES 2.0 documentation for
628 \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
632 \fn GLuint QOpenGLFunctions::glCreateProgram()
634 Convenience function that calls glCreateProgram().
636 For more information, see the OpenGL/ES 2.0 documentation for
637 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
639 This convenience function will do nothing on OpenGL/ES 1.x systems.
643 \fn GLuint QOpenGLFunctions::glCreateShader(GLenum type)
645 Convenience function that calls glCreateShader(\a type).
647 For more information, see the OpenGL/ES 2.0 documentation for
648 \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
650 This convenience function will do nothing on OpenGL/ES 1.x systems.
654 \fn void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
656 Convenience function that calls glDeleteBuffers(\a n, \a buffers).
658 For more information, see the OpenGL/ES 2.0 documentation for
659 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
663 \fn void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
665 Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
667 For more information, see the OpenGL/ES 2.0 documentation for
668 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
672 \fn void QOpenGLFunctions::glDeleteProgram(GLuint program)
674 Convenience function that calls glDeleteProgram(\a program).
676 For more information, see the OpenGL/ES 2.0 documentation for
677 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
679 This convenience function will do nothing on OpenGL/ES 1.x systems.
683 \fn void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
685 Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
687 For more information, see the OpenGL/ES 2.0 documentation for
688 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
692 \fn void QOpenGLFunctions::glDeleteShader(GLuint shader)
694 Convenience function that calls glDeleteShader(\a shader).
696 For more information, see the OpenGL/ES 2.0 documentation for
697 \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
699 This convenience function will do nothing on OpenGL/ES 1.x systems.
703 \fn void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
705 Convenience function that calls glDepthRange(\a zNear, \a zFar) on
706 desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
707 embedded OpenGL/ES systems.
709 For more information, see the OpenGL/ES 2.0 documentation for
710 \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
714 \fn void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
716 Convenience function that calls glDetachShader(\a program, \a shader).
718 For more information, see the OpenGL/ES 2.0 documentation for
719 \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
721 This convenience function will do nothing on OpenGL/ES 1.x systems.
725 \fn void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
727 Convenience function that calls glDisableVertexAttribArray(\a index).
729 For more information, see the OpenGL/ES 2.0 documentation for
730 \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
732 This convenience function will do nothing on OpenGL/ES 1.x systems.
736 \fn void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
738 Convenience function that calls glEnableVertexAttribArray(\a index).
740 For more information, see the OpenGL/ES 2.0 documentation for
741 \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
743 This convenience function will do nothing on OpenGL/ES 1.x systems.
747 \fn void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
749 Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
751 For more information, see the OpenGL/ES 2.0 documentation for
752 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
756 \fn void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
758 Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
760 For more information, see the OpenGL/ES 2.0 documentation for
761 \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
765 \fn void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
767 Convenience function that calls glGenBuffers(\a n, \a buffers).
769 For more information, see the OpenGL/ES 2.0 documentation for
770 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
774 \fn void QOpenGLFunctions::glGenerateMipmap(GLenum target)
776 Convenience function that calls glGenerateMipmap(\a target).
778 For more information, see the OpenGL/ES 2.0 documentation for
779 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
783 \fn void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
785 Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
787 For more information, see the OpenGL/ES 2.0 documentation for
788 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
792 \fn void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
794 Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
796 For more information, see the OpenGL/ES 2.0 documentation for
797 \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
801 \fn void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
803 Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
805 For more information, see the OpenGL/ES 2.0 documentation for
806 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
808 This convenience function will do nothing on OpenGL/ES 1.x systems.
812 \fn void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
814 Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
816 For more information, see the OpenGL/ES 2.0 documentation for
817 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
819 This convenience function will do nothing on OpenGL/ES 1.x systems.
823 \fn void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
825 Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
827 For more information, see the OpenGL/ES 2.0 documentation for
828 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
830 This convenience function will do nothing on OpenGL/ES 1.x systems.
834 \fn GLint QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
836 Convenience function that calls glGetAttribLocation(\a program, \a name).
838 For more information, see the OpenGL/ES 2.0 documentation for
839 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
841 This convenience function will do nothing on OpenGL/ES 1.x systems.
845 \fn void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
847 Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
849 For more information, see the OpenGL/ES 2.0 documentation for
850 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
854 \fn void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
856 Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
858 For more information, see the OpenGL/ES 2.0 documentation for
859 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
863 \fn void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
865 Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
867 For more information, see the OpenGL/ES 2.0 documentation for
868 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
870 This convenience function will do nothing on OpenGL/ES 1.x systems.
874 \fn void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
876 Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
878 For more information, see the OpenGL/ES 2.0 documentation for
879 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
881 This convenience function will do nothing on OpenGL/ES 1.x systems.
885 \fn void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
887 Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
889 For more information, see the OpenGL/ES 2.0 documentation for
890 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
894 \fn void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
896 Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
898 For more information, see the OpenGL/ES 2.0 documentation for
899 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
901 This convenience function will do nothing on OpenGL/ES 1.x systems.
905 \fn void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
907 Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
909 For more information, see the OpenGL/ES 2.0 documentation for
910 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
912 This convenience function will do nothing on OpenGL/ES 1.x systems.
916 \fn void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
918 Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
920 For more information, see the OpenGL/ES 2.0 documentation for
921 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
923 This convenience function will do nothing on OpenGL/ES 1.x systems.
927 \fn void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
929 Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
931 For more information, see the OpenGL/ES 2.0 documentation for
932 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
934 This convenience function will do nothing on OpenGL/ES 1.x systems.
938 \fn void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
940 Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
942 For more information, see the OpenGL/ES 2.0 documentation for
943 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
945 This convenience function will do nothing on OpenGL/ES 1.x systems.
949 \fn void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
951 Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
953 For more information, see the OpenGL/ES 2.0 documentation for
954 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
956 This convenience function will do nothing on OpenGL/ES 1.x systems.
960 \fn GLint QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
962 Convenience function that calls glGetUniformLocation(\a program, \a name).
964 For more information, see the OpenGL/ES 2.0 documentation for
965 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
967 This convenience function will do nothing on OpenGL/ES 1.x systems.
971 \fn void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
973 Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
975 For more information, see the OpenGL/ES 2.0 documentation for
976 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
978 This convenience function will do nothing on OpenGL/ES 1.x systems.
982 \fn void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
984 Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
986 For more information, see the OpenGL/ES 2.0 documentation for
987 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
989 This convenience function will do nothing on OpenGL/ES 1.x systems.
993 \fn void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
995 Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
997 For more information, see the OpenGL/ES 2.0 documentation for
998 \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
1000 This convenience function will do nothing on OpenGL/ES 1.x systems.
1004 \fn GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
1006 Convenience function that calls glIsBuffer(\a buffer).
1008 For more information, see the OpenGL/ES 2.0 documentation for
1009 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
1013 \fn GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
1015 Convenience function that calls glIsFramebuffer(\a framebuffer).
1017 For more information, see the OpenGL/ES 2.0 documentation for
1018 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
1022 \fn GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
1024 Convenience function that calls glIsProgram(\a program).
1026 For more information, see the OpenGL/ES 2.0 documentation for
1027 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
1029 This convenience function will do nothing on OpenGL/ES 1.x systems.
1033 \fn GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
1035 Convenience function that calls glIsRenderbuffer(\a renderbuffer).
1037 For more information, see the OpenGL/ES 2.0 documentation for
1038 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
1042 \fn GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
1044 Convenience function that calls glIsShader(\a shader).
1046 For more information, see the OpenGL/ES 2.0 documentation for
1047 \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
1049 This convenience function will do nothing on OpenGL/ES 1.x systems.
1053 \fn void QOpenGLFunctions::glLinkProgram(GLuint program)
1055 Convenience function that calls glLinkProgram(\a program).
1057 For more information, see the OpenGL/ES 2.0 documentation for
1058 \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
1060 This convenience function will do nothing on OpenGL/ES 1.x systems.
1064 \fn void QOpenGLFunctions::glReleaseShaderCompiler()
1066 Convenience function that calls glReleaseShaderCompiler().
1068 For more information, see the OpenGL/ES 2.0 documentation for
1069 \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
1071 This convenience function will do nothing on OpenGL/ES 1.x systems.
1075 \fn void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1077 Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
1079 For more information, see the OpenGL/ES 2.0 documentation for
1080 \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
1084 \fn void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
1086 Convenience function that calls glSampleCoverage(\a value, \a invert).
1088 For more information, see the OpenGL/ES 2.0 documentation for
1089 \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
1093 \fn void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
1095 Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
1097 For more information, see the OpenGL/ES 2.0 documentation for
1098 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
1100 This convenience function will do nothing on OpenGL/ES 1.x systems.
1104 \fn void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
1106 Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
1108 For more information, see the OpenGL/ES 2.0 documentation for
1109 \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
1111 This convenience function will do nothing on OpenGL/ES 1.x systems.
1115 \fn void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1117 Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1119 For more information, see the OpenGL/ES 2.0 documentation for
1120 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1124 \fn void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1126 Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1128 For more information, see the OpenGL/ES 2.0 documentation for
1129 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1133 \fn void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1135 Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1137 For more information, see the OpenGL/ES 2.0 documentation for
1138 \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1142 \fn void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
1144 Convenience function that calls glUniform1f(\a location, \a x).
1146 For more information, see the OpenGL/ES 2.0 documentation for
1147 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1149 This convenience function will do nothing on OpenGL/ES 1.x systems.
1153 \fn void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1155 Convenience function that calls glUniform1fv(\a location, \a count, \a v).
1157 For more information, see the OpenGL/ES 2.0 documentation for
1158 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
1160 This convenience function will do nothing on OpenGL/ES 1.x systems.
1164 \fn void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
1166 Convenience function that calls glUniform1i(\a location, \a x).
1168 For more information, see the OpenGL/ES 2.0 documentation for
1169 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1171 This convenience function will do nothing on OpenGL/ES 1.x systems.
1175 \fn void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1177 Convenience function that calls glUniform1iv(\a location, \a count, \a v).
1179 For more information, see the OpenGL/ES 2.0 documentation for
1180 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
1182 This convenience function will do nothing on OpenGL/ES 1.x systems.
1186 \fn void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1188 Convenience function that calls glUniform2f(\a location, \a x, \a y).
1190 For more information, see the OpenGL/ES 2.0 documentation for
1191 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1193 This convenience function will do nothing on OpenGL/ES 1.x systems.
1197 \fn void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1199 Convenience function that calls glUniform2fv(\a location, \a count, \a v).
1201 For more information, see the OpenGL/ES 2.0 documentation for
1202 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
1204 This convenience function will do nothing on OpenGL/ES 1.x systems.
1208 \fn void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1210 Convenience function that calls glUniform2i(\a location, \a x, \a y).
1212 For more information, see the OpenGL/ES 2.0 documentation for
1213 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1215 This convenience function will do nothing on OpenGL/ES 1.x systems.
1219 \fn void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1221 Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1223 For more information, see the OpenGL/ES 2.0 documentation for
1224 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1226 This convenience function will do nothing on OpenGL/ES 1.x systems.
1230 \fn void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1232 Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1234 For more information, see the OpenGL/ES 2.0 documentation for
1235 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1237 This convenience function will do nothing on OpenGL/ES 1.x systems.
1241 \fn void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1243 Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1245 For more information, see the OpenGL/ES 2.0 documentation for
1246 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1248 This convenience function will do nothing on OpenGL/ES 1.x systems.
1252 \fn void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1254 Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1256 For more information, see the OpenGL/ES 2.0 documentation for
1257 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1259 This convenience function will do nothing on OpenGL/ES 1.x systems.
1263 \fn void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1265 Convenience function that calls glUniform3iv(\a location, \a count, \a v).
1267 For more information, see the OpenGL/ES 2.0 documentation for
1268 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
1270 This convenience function will do nothing on OpenGL/ES 1.x systems.
1274 \fn void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1276 Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1278 For more information, see the OpenGL/ES 2.0 documentation for
1279 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1281 This convenience function will do nothing on OpenGL/ES 1.x systems.
1285 \fn void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1287 Convenience function that calls glUniform4fv(\a location, \a count, \a v).
1289 For more information, see the OpenGL/ES 2.0 documentation for
1290 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
1292 This convenience function will do nothing on OpenGL/ES 1.x systems.
1296 \fn void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1298 Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1300 For more information, see the OpenGL/ES 2.0 documentation for
1301 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1303 This convenience function will do nothing on OpenGL/ES 1.x systems.
1307 \fn void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1309 Convenience function that calls glUniform4iv(\a location, \a count, \a v).
1311 For more information, see the OpenGL/ES 2.0 documentation for
1312 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
1314 This convenience function will do nothing on OpenGL/ES 1.x systems.
1318 \fn void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1320 Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1322 For more information, see the OpenGL/ES 2.0 documentation for
1323 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1325 This convenience function will do nothing on OpenGL/ES 1.x systems.
1329 \fn void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1331 Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1333 For more information, see the OpenGL/ES 2.0 documentation for
1334 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1336 This convenience function will do nothing on OpenGL/ES 1.x systems.
1340 \fn void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1342 Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1344 For more information, see the OpenGL/ES 2.0 documentation for
1345 \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1347 This convenience function will do nothing on OpenGL/ES 1.x systems.
1351 \fn void QOpenGLFunctions::glUseProgram(GLuint program)
1353 Convenience function that calls glUseProgram(\a program).
1355 For more information, see the OpenGL/ES 2.0 documentation for
1356 \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1358 This convenience function will do nothing on OpenGL/ES 1.x systems.
1362 \fn void QOpenGLFunctions::glValidateProgram(GLuint program)
1364 Convenience function that calls glValidateProgram(\a program).
1366 For more information, see the OpenGL/ES 2.0 documentation for
1367 \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1369 This convenience function will do nothing on OpenGL/ES 1.x systems.
1373 \fn void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1375 Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1377 For more information, see the OpenGL/ES 2.0 documentation for
1378 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1380 This convenience function will do nothing on OpenGL/ES 1.x systems.
1384 \fn void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1386 Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1388 For more information, see the OpenGL/ES 2.0 documentation for
1389 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1391 This convenience function will do nothing on OpenGL/ES 1.x systems.
1395 \fn void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1397 Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1399 For more information, see the OpenGL/ES 2.0 documentation for
1400 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1402 This convenience function will do nothing on OpenGL/ES 1.x systems.
1406 \fn void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1408 Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1410 For more information, see the OpenGL/ES 2.0 documentation for
1411 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1413 This convenience function will do nothing on OpenGL/ES 1.x systems.
1417 \fn void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1419 Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1421 For more information, see the OpenGL/ES 2.0 documentation for
1422 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1424 This convenience function will do nothing on OpenGL/ES 1.x systems.
1428 \fn void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1430 Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1432 For more information, see the OpenGL/ES 2.0 documentation for
1433 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1435 This convenience function will do nothing on OpenGL/ES 1.x systems.
1439 \fn void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1441 Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1443 For more information, see the OpenGL/ES 2.0 documentation for
1444 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1446 This convenience function will do nothing on OpenGL/ES 1.x systems.
1450 \fn void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1452 Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1454 For more information, see the OpenGL/ES 2.0 documentation for
1455 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1457 This convenience function will do nothing on OpenGL/ES 1.x systems.
1461 \fn void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1463 Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1465 For more information, see the OpenGL/ES 2.0 documentation for
1466 \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1468 This convenience function will do nothing on OpenGL/ES 1.x systems.
1472 \fn bool QOpenGLFunctions::isInitialized(const QOpenGLFunctionsPrivate *d)
1484 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1488 Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1489 : funcPointerName(func)
1490 , fallbackFuncPointer(fallback)
1492 , alternateFuncName(alternateName)
1496 ReturnType operator()();
1498 template <typename P1>
1499 ReturnType operator()(P1 p1);
1501 template <typename P1, typename P2>
1502 ReturnType operator()(P1 p1, P2 p2);
1504 template <typename P1, typename P2, typename P3>
1505 ReturnType operator()(P1 p1, P2 p2, P3 p3);
1507 template <typename P1, typename P2, typename P3, typename P4>
1508 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1510 template <typename P1, typename P2, typename P3, typename P4, typename P5>
1511 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1513 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1514 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1516 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1517 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1519 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1520 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1522 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1523 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1525 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1526 ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1529 FuncType Base::*funcPointerName;
1530 FuncType fallbackFuncPointer;
1531 QByteArray funcName;
1532 QByteArray alternateFuncName;
1535 template <typename Base, typename FuncType, int Policy>
1536 class Resolver<Base, FuncType, Policy, void>
1539 Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1540 : funcPointerName(func)
1541 , fallbackFuncPointer(fallback)
1543 , alternateFuncName(alternateName)
1549 template <typename P1>
1550 void operator()(P1 p1);
1552 template <typename P1, typename P2>
1553 void operator()(P1 p1, P2 p2);
1555 template <typename P1, typename P2, typename P3>
1556 void operator()(P1 p1, P2 p2, P3 p3);
1558 template <typename P1, typename P2, typename P3, typename P4>
1559 void operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1561 template <typename P1, typename P2, typename P3, typename P4, typename P5>
1562 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1564 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1565 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1567 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1568 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1570 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1571 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1573 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1574 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1576 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1577 void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1580 FuncType Base::*funcPointerName;
1581 FuncType fallbackFuncPointer;
1582 QByteArray funcName;
1583 QByteArray alternateFuncName;
1586 #define RESOLVER_COMMON \
1587 QOpenGLContext *context = QOpenGLContext::currentContext(); \
1588 Base *funcs = qt_gl_functions(context); \
1590 FuncType old = funcs->*funcPointerName; \
1592 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName); \
1594 if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1595 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "OES"); \
1597 if (!(funcs->*funcPointerName)) \
1598 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "ARB"); \
1600 if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1601 funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "EXT"); \
1603 if (!alternateFuncName.isEmpty() && !(funcs->*funcPointerName)) { \
1604 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName); \
1606 if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1607 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "OES"); \
1609 if (!(funcs->*funcPointerName)) \
1610 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "ARB"); \
1612 if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1613 funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "EXT"); \
1616 #define RESOLVER_COMMON_NON_VOID \
1619 if (!(funcs->*funcPointerName)) { \
1620 if (fallbackFuncPointer) { \
1621 funcs->*funcPointerName = fallbackFuncPointer; \
1623 funcs->*funcPointerName = old; \
1624 return ReturnType(); \
1628 #define RESOLVER_COMMON_VOID \
1631 if (!(funcs->*funcPointerName)) { \
1632 if (fallbackFuncPointer) { \
1633 funcs->*funcPointerName = fallbackFuncPointer; \
1635 funcs->*funcPointerName = old; \
1640 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1641 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()()
1643 RESOLVER_COMMON_NON_VOID
1645 return (funcs->*funcPointerName)();
1648 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1>
1649 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1)
1651 RESOLVER_COMMON_NON_VOID
1653 return (funcs->*funcPointerName)(p1);
1656 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2>
1657 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2)
1659 RESOLVER_COMMON_NON_VOID
1661 return (funcs->*funcPointerName)(p1, p2);
1664 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3>
1665 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3)
1667 RESOLVER_COMMON_NON_VOID
1669 return (funcs->*funcPointerName)(p1, p2, p3);
1672 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4>
1673 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1675 RESOLVER_COMMON_NON_VOID
1677 return (funcs->*funcPointerName)(p1, p2, p3, p4);
1680 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1681 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1683 RESOLVER_COMMON_NON_VOID
1685 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1688 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1689 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1691 RESOLVER_COMMON_NON_VOID
1693 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1696 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1697 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1699 RESOLVER_COMMON_NON_VOID
1701 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1704 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>
1705 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1707 RESOLVER_COMMON_NON_VOID
1709 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1712 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>
1713 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)
1715 RESOLVER_COMMON_NON_VOID
1717 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1720 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>
1721 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)
1723 RESOLVER_COMMON_NON_VOID
1725 return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1728 template <typename Base, typename FuncType, int Policy>
1729 void Resolver<Base, FuncType, Policy, void>::operator()()
1731 RESOLVER_COMMON_VOID
1733 (funcs->*funcPointerName)();
1736 template <typename Base, typename FuncType, int Policy> template <typename P1>
1737 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1)
1739 RESOLVER_COMMON_VOID
1741 (funcs->*funcPointerName)(p1);
1744 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2>
1745 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2)
1747 RESOLVER_COMMON_VOID
1749 (funcs->*funcPointerName)(p1, p2);
1752 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3>
1753 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3)
1755 RESOLVER_COMMON_VOID
1757 (funcs->*funcPointerName)(p1, p2, p3);
1760 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4>
1761 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1763 RESOLVER_COMMON_VOID
1765 (funcs->*funcPointerName)(p1, p2, p3, p4);
1768 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1769 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1771 RESOLVER_COMMON_VOID
1773 (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1776 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1777 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1779 RESOLVER_COMMON_VOID
1781 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1784 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1785 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1787 RESOLVER_COMMON_VOID
1789 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1792 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1793 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1795 RESOLVER_COMMON_VOID
1797 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1800 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>
1801 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)
1803 RESOLVER_COMMON_VOID
1805 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1808 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>
1809 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)
1811 RESOLVER_COMMON_VOID
1813 (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1816 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1817 Resolver<Base, FuncType, Policy, ReturnType> functionResolverWithFallback(FuncType Base::*func, FuncType fallback, const char *name, const char *alternate = 0)
1819 return Resolver<Base, FuncType, Policy, ReturnType>(func, fallback, name, alternate);
1822 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1823 Resolver<Base, FuncType, Policy, ReturnType> functionResolver(FuncType Base::*func, const char *name, const char *alternate = 0)
1825 return Resolver<Base, FuncType, Policy, ReturnType>(func, 0, name, alternate);
1830 #define RESOLVE_FUNC(RETURN_TYPE, POLICY, NAME) \
1831 return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1833 #define RESOLVE_FUNC_VOID(POLICY, NAME) \
1834 functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1836 #define RESOLVE_FUNC_SPECIAL(RETURN_TYPE, POLICY, NAME) \
1837 return functionResolverWithFallback<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1839 #define RESOLVE_FUNC_SPECIAL_VOID(POLICY, NAME) \
1840 functionResolverWithFallback<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1842 #define RESOLVE_FUNC_WITH_ALTERNATE(RETURN_TYPE, POLICY, NAME, ALTERNATE) \
1843 return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1845 #define RESOLVE_FUNC_VOID_WITH_ALTERNATE(POLICY, NAME, ALTERNATE) \
1846 functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1848 #ifndef QT_OPENGL_ES_2
1850 static void QOPENGLF_APIENTRY qopenglfResolveActiveTexture(GLenum texture)
1852 RESOLVE_FUNC_VOID(0, ActiveTexture)(texture);
1855 static void QOPENGLF_APIENTRY qopenglfResolveAttachShader(GLuint program, GLuint shader)
1857 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, AttachShader, AttachObject)(program, shader);
1860 static void QOPENGLF_APIENTRY qopenglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1862 RESOLVE_FUNC_VOID(0, BindAttribLocation)(program, index, name);
1865 static void QOPENGLF_APIENTRY qopenglfResolveBindBuffer(GLenum target, GLuint buffer)
1867 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindBuffer)(target, buffer);
1870 static void QOPENGLF_APIENTRY qopenglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1872 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindFramebuffer)(target, framebuffer);
1875 static void QOPENGLF_APIENTRY qopenglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1877 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindRenderbuffer)(target, renderbuffer);
1880 static void QOPENGLF_APIENTRY qopenglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1882 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendColor)(red, green, blue, alpha);
1885 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquation(GLenum mode)
1887 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquation)(mode);
1890 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1892 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquationSeparate)(modeRGB, modeAlpha);
1895 static void QOPENGLF_APIENTRY qopenglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1897 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha);
1900 static void QOPENGLF_APIENTRY qopenglfResolveBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
1902 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferData)(target, size, data, usage);
1905 static void QOPENGLF_APIENTRY qopenglfResolveBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
1907 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferSubData)(target, offset, size, data);
1910 static GLenum QOPENGLF_APIENTRY qopenglfResolveCheckFramebufferStatus(GLenum target)
1912 RESOLVE_FUNC(GLenum, ResolveOES | ResolveEXT, CheckFramebufferStatus)(target);
1915 static void QOPENGLF_APIENTRY qopenglfResolveCompileShader(GLuint shader)
1917 RESOLVE_FUNC_VOID(0, CompileShader)(shader);
1920 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1922 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexImage2D)(target, level, internalformat, width, height, border, imageSize, data);
1925 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1927 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1930 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateProgram()
1932 RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateProgram, CreateProgramObject)();
1935 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateShader(GLenum type)
1937 RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateShader, CreateShaderObject)(type);
1940 static void QOPENGLF_APIENTRY qopenglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1942 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteBuffers)(n, buffers);
1945 static void QOPENGLF_APIENTRY qopenglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1947 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteFramebuffers)(n, framebuffers);
1950 static void QOPENGLF_APIENTRY qopenglfResolveDeleteProgram(GLuint program)
1952 RESOLVE_FUNC_VOID(0, DeleteProgram)(program);
1955 static void QOPENGLF_APIENTRY qopenglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1957 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteRenderbuffers)(n, renderbuffers);
1960 static void QOPENGLF_APIENTRY qopenglfResolveDeleteShader(GLuint shader)
1962 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DeleteShader, DeleteObject)(shader);
1965 static void QOPENGLF_APIENTRY qopenglfResolveDetachShader(GLuint program, GLuint shader)
1967 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DetachShader, DetachObject)(program, shader);
1970 static void QOPENGLF_APIENTRY qopenglfResolveDisableVertexAttribArray(GLuint index)
1972 RESOLVE_FUNC_VOID(0, DisableVertexAttribArray)(index);
1975 static void QOPENGLF_APIENTRY qopenglfResolveEnableVertexAttribArray(GLuint index)
1977 RESOLVE_FUNC_VOID(0, EnableVertexAttribArray)(index);
1980 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1982 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferRenderbuffer)(target, attachment, renderbuffertarget, renderbuffer);
1985 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1987 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferTexture2D)(target, attachment, textarget, texture, level);
1990 static void QOPENGLF_APIENTRY qopenglfResolveGenBuffers(GLsizei n, GLuint* buffers)
1992 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenBuffers)(n, buffers);
1995 static void QOPENGLF_APIENTRY qopenglfResolveGenerateMipmap(GLenum target)
1997 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenerateMipmap)(target);
2000 static void QOPENGLF_APIENTRY qopenglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
2002 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenFramebuffers)(n, framebuffers);
2005 static void QOPENGLF_APIENTRY qopenglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2007 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenRenderbuffers)(n, renderbuffers);
2010 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2012 RESOLVE_FUNC_VOID(0, GetActiveAttrib)(program, index, bufsize, length, size, type, name);
2015 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2017 RESOLVE_FUNC_VOID(0, GetActiveUniform)(program, index, bufsize, length, size, type, name);
2020 static void QOPENGLF_APIENTRY qopenglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2022 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetAttachedShaders, GetAttachedObjects)(program, maxcount, count, shaders);
2025 static GLint QOPENGLF_APIENTRY qopenglfResolveGetAttribLocation(GLuint program, const char* name)
2027 RESOLVE_FUNC(GLint, 0, GetAttribLocation)(program, name);
2030 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2032 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetBufferParameteriv)(target, pname, params);
2035 static void QOPENGLF_APIENTRY qopenglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2037 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetFramebufferAttachmentParameteriv)(target, attachment, pname, params);
2040 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2042 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramiv, GetObjectParameteriv)(program, pname, params);
2045 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2047 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramInfoLog, GetInfoLog)(program, bufsize, length, infolog);
2050 static void QOPENGLF_APIENTRY qopenglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2052 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetRenderbufferParameteriv)(target, pname, params);
2055 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2057 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderiv, GetObjectParameteriv)(shader, pname, params);
2060 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2062 RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderInfoLog, GetInfoLog)(shader, bufsize, length, infolog);
2065 static void QOPENGLF_APIENTRY qopenglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2067 Q_UNUSED(shadertype);
2068 Q_UNUSED(precisiontype);
2069 range[0] = range[1] = precision[0] = 0;
2072 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2074 RESOLVE_FUNC_SPECIAL_VOID(ResolveOES | ResolveEXT, GetShaderPrecisionFormat)(shadertype, precisiontype, range, precision);
2077 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2079 RESOLVE_FUNC_VOID(0, GetShaderSource)(shader, bufsize, length, source);
2082 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2084 RESOLVE_FUNC_VOID(0, GetUniformfv)(program, location, params);
2087 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2089 RESOLVE_FUNC_VOID(0, GetUniformiv)(program, location, params);
2092 static GLint QOPENGLF_APIENTRY qopenglfResolveGetUniformLocation(GLuint program, const char* name)
2094 RESOLVE_FUNC(GLint, 0, GetUniformLocation)(program, name);
2097 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2099 RESOLVE_FUNC_VOID(0, GetVertexAttribfv)(index, pname, params);
2102 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2104 RESOLVE_FUNC_VOID(0, GetVertexAttribiv)(index, pname, params);
2107 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2109 RESOLVE_FUNC_VOID(0, GetVertexAttribPointerv)(index, pname, pointer);
2112 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsBuffer(GLuint buffer)
2114 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsBuffer)(buffer);
2117 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsFramebuffer(GLuint framebuffer)
2119 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsFramebuffer)(framebuffer);
2122 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsProgram(GLuint program)
2124 return program != 0;
2127 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsProgram(GLuint program)
2129 RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsProgram)(program);
2132 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsRenderbuffer(GLuint renderbuffer)
2134 RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsRenderbuffer)(renderbuffer);
2137 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsShader(GLuint shader)
2142 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsShader(GLuint shader)
2144 RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsShader)(shader);
2147 static void QOPENGLF_APIENTRY qopenglfResolveLinkProgram(GLuint program)
2149 RESOLVE_FUNC_VOID(0, LinkProgram)(program);
2152 static void QOPENGLF_APIENTRY qopenglfSpecialReleaseShaderCompiler()
2156 static void QOPENGLF_APIENTRY qopenglfResolveReleaseShaderCompiler()
2158 RESOLVE_FUNC_SPECIAL_VOID(0, ReleaseShaderCompiler)();
2161 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2163 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, RenderbufferStorage)(target, internalformat, width, height);
2166 static void QOPENGLF_APIENTRY qopenglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2168 RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, SampleCoverage)(value, invert);
2171 static void QOPENGLF_APIENTRY qopenglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2173 RESOLVE_FUNC_VOID(0, ShaderBinary)(n, shaders, binaryformat, binary, length);
2176 static void QOPENGLF_APIENTRY qopenglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2178 RESOLVE_FUNC_VOID(0, ShaderSource)(shader, count, string, length);
2181 static void QOPENGLF_APIENTRY qopenglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2183 RESOLVE_FUNC_VOID(ResolveEXT, StencilFuncSeparate)(face, func, ref, mask);
2186 static void QOPENGLF_APIENTRY qopenglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2188 RESOLVE_FUNC_VOID(ResolveEXT, StencilMaskSeparate)(face, mask);
2191 static void QOPENGLF_APIENTRY qopenglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2193 RESOLVE_FUNC_VOID(ResolveEXT, StencilOpSeparate)(face, fail, zfail, zpass);
2196 static void QOPENGLF_APIENTRY qopenglfResolveUniform1f(GLint location, GLfloat x)
2198 RESOLVE_FUNC_VOID(0, Uniform1f)(location, x);
2201 static void QOPENGLF_APIENTRY qopenglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
2203 RESOLVE_FUNC_VOID(0, Uniform1fv)(location, count, v);
2206 static void QOPENGLF_APIENTRY qopenglfResolveUniform1i(GLint location, GLint x)
2208 RESOLVE_FUNC_VOID(0, Uniform1i)(location, x);
2211 static void QOPENGLF_APIENTRY qopenglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
2213 RESOLVE_FUNC_VOID(0, Uniform1iv)(location, count, v);
2216 static void QOPENGLF_APIENTRY qopenglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
2218 RESOLVE_FUNC_VOID(0, Uniform2f)(location, x, y);
2221 static void QOPENGLF_APIENTRY qopenglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
2223 RESOLVE_FUNC_VOID(0, Uniform2fv)(location, count, v);
2226 static void QOPENGLF_APIENTRY qopenglfResolveUniform2i(GLint location, GLint x, GLint y)
2228 RESOLVE_FUNC_VOID(0, Uniform2i)(location, x, y);
2231 static void QOPENGLF_APIENTRY qopenglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
2233 RESOLVE_FUNC_VOID(0, Uniform2iv)(location, count, v);
2236 static void QOPENGLF_APIENTRY qopenglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
2238 RESOLVE_FUNC_VOID(0, Uniform3f)(location, x, y, z);
2241 static void QOPENGLF_APIENTRY qopenglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
2243 RESOLVE_FUNC_VOID(0, Uniform3fv)(location, count, v);
2246 static void QOPENGLF_APIENTRY qopenglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
2248 RESOLVE_FUNC_VOID(0, Uniform3i)(location, x, y, z);
2251 static void QOPENGLF_APIENTRY qopenglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
2253 RESOLVE_FUNC_VOID(0, Uniform3iv)(location, count, v);
2256 static void QOPENGLF_APIENTRY qopenglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2258 RESOLVE_FUNC_VOID(0, Uniform4f)(location, x, y, z, w);
2261 static void QOPENGLF_APIENTRY qopenglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
2263 RESOLVE_FUNC_VOID(0, Uniform4fv)(location, count, v);
2266 static void QOPENGLF_APIENTRY qopenglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
2268 RESOLVE_FUNC_VOID(0, Uniform4i)(location, x, y, z, w);
2271 static void QOPENGLF_APIENTRY qopenglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
2273 RESOLVE_FUNC_VOID(0, Uniform4iv)(location, count, v);
2276 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2278 RESOLVE_FUNC_VOID(0, UniformMatrix2fv)(location, count, transpose, value);
2281 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2283 RESOLVE_FUNC_VOID(0, UniformMatrix3fv)(location, count, transpose, value);
2286 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2288 RESOLVE_FUNC_VOID(0, UniformMatrix4fv)(location, count, transpose, value);
2291 static void QOPENGLF_APIENTRY qopenglfResolveUseProgram(GLuint program)
2293 RESOLVE_FUNC_VOID(0, UseProgram)(program);
2296 static void QOPENGLF_APIENTRY qopenglfResolveValidateProgram(GLuint program)
2298 RESOLVE_FUNC_VOID(0, ValidateProgram)(program);
2301 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
2303 RESOLVE_FUNC_VOID(0, VertexAttrib1f)(indx, x);
2306 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
2308 RESOLVE_FUNC_VOID(0, VertexAttrib1fv)(indx, values);
2311 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
2313 RESOLVE_FUNC_VOID(0, VertexAttrib2f)(indx, x, y);
2316 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
2318 RESOLVE_FUNC_VOID(0, VertexAttrib2fv)(indx, values);
2321 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
2323 RESOLVE_FUNC_VOID(0, VertexAttrib3f)(indx, x, y, z);
2326 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
2328 RESOLVE_FUNC_VOID(0, VertexAttrib3fv)(indx, values);
2331 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2333 RESOLVE_FUNC_VOID(0, VertexAttrib4f)(indx, x, y, z, w);
2336 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
2338 RESOLVE_FUNC_VOID(0, VertexAttrib4fv)(indx, values);
2341 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
2343 RESOLVE_FUNC_VOID(0, VertexAttribPointer)(indx, size, type, normalized, stride, ptr);
2346 #endif // !QT_OPENGL_ES_2
2348 static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum access)
2350 RESOLVE_FUNC(GLvoid *, ResolveOES, MapBuffer)(target, access);
2353 static GLboolean QOPENGLF_APIENTRY qopenglfResolveUnmapBuffer(GLenum target)
2355 RESOLVE_FUNC(GLboolean, ResolveOES, UnmapBuffer)(target);
2358 static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
2359 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
2360 GLbitfield mask, GLenum filter)
2362 RESOLVE_FUNC_VOID(ResolveEXT, BlitFramebuffer)
2363 (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
2366 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples,
2367 GLenum internalFormat,
2368 GLsizei width, GLsizei height)
2370 RESOLVE_FUNC_VOID(ResolveEXT, RenderbufferStorageMultisample)
2371 (target, samples, internalFormat, width, height);
2374 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
2376 RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
2377 (target, offset, size, data);
2380 QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(QOpenGLContext *)
2382 /* Assign a pointer to an above defined static function
2383 * which on first call resolves the function from the current
2384 * context, assigns it to the member variable and executes it
2385 * (see Resolver template) */
2386 #ifndef QT_OPENGL_ES_2
2387 ActiveTexture = qopenglfResolveActiveTexture;
2388 AttachShader = qopenglfResolveAttachShader;
2389 BindAttribLocation = qopenglfResolveBindAttribLocation;
2390 BindBuffer = qopenglfResolveBindBuffer;
2391 BindFramebuffer = qopenglfResolveBindFramebuffer;
2392 BindRenderbuffer = qopenglfResolveBindRenderbuffer;
2393 BlendColor = qopenglfResolveBlendColor;
2394 BlendEquation = qopenglfResolveBlendEquation;
2395 BlendEquationSeparate = qopenglfResolveBlendEquationSeparate;
2396 BlendFuncSeparate = qopenglfResolveBlendFuncSeparate;
2397 BufferData = qopenglfResolveBufferData;
2398 BufferSubData = qopenglfResolveBufferSubData;
2399 CheckFramebufferStatus = qopenglfResolveCheckFramebufferStatus;
2400 CompileShader = qopenglfResolveCompileShader;
2401 CompressedTexImage2D = qopenglfResolveCompressedTexImage2D;
2402 CompressedTexSubImage2D = qopenglfResolveCompressedTexSubImage2D;
2403 CreateProgram = qopenglfResolveCreateProgram;
2404 CreateShader = qopenglfResolveCreateShader;
2405 DeleteBuffers = qopenglfResolveDeleteBuffers;
2406 DeleteFramebuffers = qopenglfResolveDeleteFramebuffers;
2407 DeleteProgram = qopenglfResolveDeleteProgram;
2408 DeleteRenderbuffers = qopenglfResolveDeleteRenderbuffers;
2409 DeleteShader = qopenglfResolveDeleteShader;
2410 DetachShader = qopenglfResolveDetachShader;
2411 DisableVertexAttribArray = qopenglfResolveDisableVertexAttribArray;
2412 EnableVertexAttribArray = qopenglfResolveEnableVertexAttribArray;
2413 FramebufferRenderbuffer = qopenglfResolveFramebufferRenderbuffer;
2414 FramebufferTexture2D = qopenglfResolveFramebufferTexture2D;
2415 GenBuffers = qopenglfResolveGenBuffers;
2416 GenerateMipmap = qopenglfResolveGenerateMipmap;
2417 GenFramebuffers = qopenglfResolveGenFramebuffers;
2418 GenRenderbuffers = qopenglfResolveGenRenderbuffers;
2419 GetActiveAttrib = qopenglfResolveGetActiveAttrib;
2420 GetActiveUniform = qopenglfResolveGetActiveUniform;
2421 GetAttachedShaders = qopenglfResolveGetAttachedShaders;
2422 GetAttribLocation = qopenglfResolveGetAttribLocation;
2423 GetBufferParameteriv = qopenglfResolveGetBufferParameteriv;
2424 GetFramebufferAttachmentParameteriv = qopenglfResolveGetFramebufferAttachmentParameteriv;
2425 GetProgramiv = qopenglfResolveGetProgramiv;
2426 GetProgramInfoLog = qopenglfResolveGetProgramInfoLog;
2427 GetRenderbufferParameteriv = qopenglfResolveGetRenderbufferParameteriv;
2428 GetShaderiv = qopenglfResolveGetShaderiv;
2429 GetShaderInfoLog = qopenglfResolveGetShaderInfoLog;
2430 GetShaderPrecisionFormat = qopenglfResolveGetShaderPrecisionFormat;
2431 GetShaderSource = qopenglfResolveGetShaderSource;
2432 GetUniformfv = qopenglfResolveGetUniformfv;
2433 GetUniformiv = qopenglfResolveGetUniformiv;
2434 GetUniformLocation = qopenglfResolveGetUniformLocation;
2435 GetVertexAttribfv = qopenglfResolveGetVertexAttribfv;
2436 GetVertexAttribiv = qopenglfResolveGetVertexAttribiv;
2437 GetVertexAttribPointerv = qopenglfResolveGetVertexAttribPointerv;
2438 IsBuffer = qopenglfResolveIsBuffer;
2439 IsFramebuffer = qopenglfResolveIsFramebuffer;
2440 IsProgram = qopenglfResolveIsProgram;
2441 IsRenderbuffer = qopenglfResolveIsRenderbuffer;
2442 IsShader = qopenglfResolveIsShader;
2443 LinkProgram = qopenglfResolveLinkProgram;
2444 ReleaseShaderCompiler = qopenglfResolveReleaseShaderCompiler;
2445 RenderbufferStorage = qopenglfResolveRenderbufferStorage;
2446 SampleCoverage = qopenglfResolveSampleCoverage;
2447 ShaderBinary = qopenglfResolveShaderBinary;
2448 ShaderSource = qopenglfResolveShaderSource;
2449 StencilFuncSeparate = qopenglfResolveStencilFuncSeparate;
2450 StencilMaskSeparate = qopenglfResolveStencilMaskSeparate;
2451 StencilOpSeparate = qopenglfResolveStencilOpSeparate;
2452 Uniform1f = qopenglfResolveUniform1f;
2453 Uniform1fv = qopenglfResolveUniform1fv;
2454 Uniform1i = qopenglfResolveUniform1i;
2455 Uniform1iv = qopenglfResolveUniform1iv;
2456 Uniform2f = qopenglfResolveUniform2f;
2457 Uniform2fv = qopenglfResolveUniform2fv;
2458 Uniform2i = qopenglfResolveUniform2i;
2459 Uniform2iv = qopenglfResolveUniform2iv;
2460 Uniform3f = qopenglfResolveUniform3f;
2461 Uniform3fv = qopenglfResolveUniform3fv;
2462 Uniform3i = qopenglfResolveUniform3i;
2463 Uniform3iv = qopenglfResolveUniform3iv;
2464 Uniform4f = qopenglfResolveUniform4f;
2465 Uniform4fv = qopenglfResolveUniform4fv;
2466 Uniform4i = qopenglfResolveUniform4i;
2467 Uniform4iv = qopenglfResolveUniform4iv;
2468 UniformMatrix2fv = qopenglfResolveUniformMatrix2fv;
2469 UniformMatrix3fv = qopenglfResolveUniformMatrix3fv;
2470 UniformMatrix4fv = qopenglfResolveUniformMatrix4fv;
2471 UseProgram = qopenglfResolveUseProgram;
2472 ValidateProgram = qopenglfResolveValidateProgram;
2473 VertexAttrib1f = qopenglfResolveVertexAttrib1f;
2474 VertexAttrib1fv = qopenglfResolveVertexAttrib1fv;
2475 VertexAttrib2f = qopenglfResolveVertexAttrib2f;
2476 VertexAttrib2fv = qopenglfResolveVertexAttrib2fv;
2477 VertexAttrib3f = qopenglfResolveVertexAttrib3f;
2478 VertexAttrib3fv = qopenglfResolveVertexAttrib3fv;
2479 VertexAttrib4f = qopenglfResolveVertexAttrib4f;
2480 VertexAttrib4fv = qopenglfResolveVertexAttrib4fv;
2481 VertexAttribPointer = qopenglfResolveVertexAttribPointer;
2482 #endif // !QT_OPENGL_ES_2
2485 QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
2486 : QOpenGLFunctionsPrivate(ctx)
2488 MapBuffer = qopenglfResolveMapBuffer;
2489 UnmapBuffer = qopenglfResolveUnmapBuffer;
2490 BlitFramebuffer = qopenglfResolveBlitFramebuffer;
2491 RenderbufferStorageMultisample = qopenglfResolveRenderbufferStorageMultisample;
2492 GetBufferSubData = qopenglfResolveGetBufferSubData;