Doc: Fix some documentation issues.
[profile/ivi/qtbase.git] / src / gui / opengl / qopenglfunctions.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qopenglfunctions.h"
43 #include "qopenglextensions_p.h"
44 #include "qdebug.h"
45 #include "QtGui/private/qopenglcontext_p.h"
46 #include "QtGui/private/qopengl_p.h"
47
48 QT_BEGIN_NAMESPACE
49
50 /*!
51     \class QOpenGLFunctions
52     \brief The QOpenGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
53     \since 5.0
54     \ingroup painting-3D
55     \inmodule QtGui
56
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.
61
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
65     direct inheritance:
66
67     \code
68     class MyGLWindow : public QWindow, protected QOpenGLFunctions
69     {
70         Q_OBJECT
71     public:
72         MyGLWindow(QScreen *screen = 0);
73
74     protected:
75         void initializeGL();
76         void paintGL();
77
78         QOpenGLContext *m_context;
79     };
80
81     MyGLWindow(QScreen *screen)
82       : QWindow(screen), QOpenGLWidget(parent)
83     {
84         setSurfaceType(OpenGLSurface);
85         create();
86
87         // Create an OpenGL context
88         m_context = new QOpenGLContext;
89         m_context->create();
90
91         // Setup scene and render it
92         initializeGL();
93         paintGL()
94     }
95
96     void MyGLWindow::initializeGL()
97     {
98         m_context->makeCurrent(this);
99         initializeOpenGLFunctions();
100     }
101     \endcode
102
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:
106
107     \code
108     void MyGLWindow::paintGL()
109     {
110         m_context->makeCurrent(this);
111         glActiveTexture(GL_TEXTURE1);
112         glBindTexture(GL_TEXTURE_2D, textureId);
113         ...
114         m_context->swapBuffers(this);
115         m_context->doneCurrent();
116     }
117     \endcode
118
119     QOpenGLFunctions can also be used directly for ad-hoc invocation
120     of OpenGL/ES 2.0 functions on all platforms:
121
122     \code
123     QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
124     glFuncs.glActiveTexture(GL_TEXTURE1);
125     \endcode
126
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.
130
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:
135
136     \code
137     QOpenGLFunctions funcs(QOpenGLContext::currentContext());
138     bool npot = funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
139     \endcode
140 */
141
142 /*!
143     \enum QOpenGLFunctions::OpenGLFeature
144     This enum defines OpenGL/ES 2.0 features that may be optional
145     on other platforms.
146
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.
161 */
162
163 // Hidden private fields for additional extension data.
164 struct QOpenGLFunctionsPrivateEx : public QOpenGLExtensionsPrivate, public QOpenGLSharedResource
165 {
166     QOpenGLFunctionsPrivateEx(QOpenGLContext *context)
167         : QOpenGLExtensionsPrivate(context)
168         , QOpenGLSharedResource(context->shareGroup())
169         , m_features(-1)
170         , m_extensions(-1)
171     {}
172
173     void invalidateResource()
174     {
175         m_features = -1;
176         m_extensions = -1;
177     }
178
179     void freeResource(QOpenGLContext *)
180     {
181         // no gl resources to free
182     }
183
184     int m_features;
185     int m_extensions;
186 };
187
188 Q_GLOBAL_STATIC(QOpenGLMultiGroupSharedResource, qt_gl_functions_resource)
189
190 static QOpenGLFunctionsPrivateEx *qt_gl_functions(QOpenGLContext *context = 0)
191 {
192     if (!context)
193         context = QOpenGLContext::currentContext();
194     Q_ASSERT(context);
195     QOpenGLFunctionsPrivateEx *funcs =
196         qt_gl_functions_resource()->value<QOpenGLFunctionsPrivateEx>(context);
197     return funcs;
198 }
199
200 /*!
201     Constructs a default function resolver. The resolver cannot
202     be used until initializeOpenGLFunctions() is called to specify
203     the context.
204
205     \sa initializeOpenGLFunctions()
206 */
207 QOpenGLFunctions::QOpenGLFunctions()
208     : d_ptr(0)
209 {
210 }
211
212 /*!
213     Constructs a function resolver for \a context.  If \a context
214     is null, then the resolver will be created for the current QOpenGLContext.
215
216     The context or another context in the group must be current.
217
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.
221
222     \sa initializeOpenGLFunctions()
223 */
224 QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context)
225     : d_ptr(0)
226 {
227     if (context && QOpenGLContextGroup::currentContextGroup() == context->shareGroup())
228         d_ptr = qt_gl_functions(context);
229     else
230         qWarning() << "QOpenGLFunctions created with non-current context";
231 }
232
233 QOpenGLExtensions::QOpenGLExtensions()
234     : QOpenGLFunctions()
235 {
236 }
237
238 QOpenGLExtensions::QOpenGLExtensions(QOpenGLContext *context)
239     : QOpenGLFunctions(context)
240 {
241 }
242
243 /*!
244     \fn QOpenGLFunctions::~QOpenGLFunctions()
245
246     Destroys this function resolver.
247 */
248
249 static int qt_gl_resolve_features()
250 {
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;
270     return features;
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;
289     return features;
290 #else
291     int features = 0;
292     //QOpenGLFormat::OpenGLVersionFlags versions = QOpenGLFormat::openGLVersionFlags();
293     QOpenGLExtensionMatcher extensions;
294
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;
317
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;
330     return features;
331 #endif
332 }
333
334 static int qt_gl_resolve_extensions()
335 {
336     int extensions = 0;
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;
347 #else
348     extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
349
350     // Recognize features by extension name.
351     if (extensionMatcher.match("GL_ARB_framebuffer_object")) {
352         extensions |= QOpenGLExtensions::FramebufferMultisample |
353                       QOpenGLExtensions::FramebufferBlit |
354                       QOpenGLExtensions::PackedDepthStencil;
355     } else {
356         if (extensionMatcher.match("GL_EXT_framebuffer_multisample"))
357             extensions |= QOpenGLExtensions::FramebufferMultisample;
358         if (extensionMatcher.match("GL_EXT_framebuffer_blit"))
359             extensions |= QOpenGLExtensions::FramebufferBlit;
360         if (extensionMatcher.match("GL_EXT_packed_depth_stencil"))
361             extensions |= QOpenGLExtensions::PackedDepthStencil;
362     }
363 #endif
364     return extensions;
365 }
366
367 /*!
368     Returns the set of features that are present on this system's
369     OpenGL implementation.
370
371     It is assumed that the QOpenGLContext associated with this function
372     resolver is current.
373
374     \sa hasOpenGLFeature()
375 */
376 QOpenGLFunctions::OpenGLFeatures QOpenGLFunctions::openGLFeatures() const
377 {
378     QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
379     if (!d)
380         return 0;
381     if (d->m_features == -1)
382         d->m_features = qt_gl_resolve_features();
383     return QOpenGLFunctions::OpenGLFeatures(d->m_features);
384 }
385
386 /*!
387     Returns true if \a feature is present on this system's OpenGL
388     implementation; false otherwise.
389
390     It is assumed that the QOpenGLContext associated with this function
391     resolver is current.
392
393     \sa openGLFeatures()
394 */
395 bool QOpenGLFunctions::hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const
396 {
397     QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
398     if (!d)
399         return false;
400     if (d->m_features == -1)
401         d->m_features = qt_gl_resolve_features();
402     return (d->m_features & int(feature)) != 0;
403 }
404
405 /*!
406     Returns the set of extensions that are present on this system's
407     OpenGL implementation.
408
409     It is assumed that the QOpenGLContext associated with this extension
410     resolver is current.
411
412     \sa hasOpenGLExtensions()
413 */
414 QOpenGLExtensions::OpenGLExtensions QOpenGLExtensions::openGLExtensions()
415 {
416     QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
417     if (!d)
418         return 0;
419     if (d->m_extensions == -1)
420         d->m_extensions = qt_gl_resolve_extensions();
421     return QOpenGLExtensions::OpenGLExtensions(d->m_extensions);
422 }
423
424 /*!
425     Returns true if \a extension is present on this system's OpenGL
426     implementation; false otherwise.
427
428     It is assumed that the QOpenGLContext associated with this extension
429     resolver is current.
430
431     \sa openGLFeatures()
432 */
433 bool QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension extension) const
434 {
435     QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
436     if (!d)
437         return false;
438     if (d->m_extensions == -1)
439         d->m_extensions = qt_gl_resolve_extensions();
440     return (d->m_extensions & int(extension)) != 0;
441 }
442
443 /*!
444     \fn void QOpenGLFunctions::initializeGLFunctions()
445     \obsolete
446
447     Use initializeOpenGLFunctions() instead.
448 */
449
450 /*!
451     Initializes OpenGL function resolution for the current context.
452
453     After calling this function, the QOpenGLFunctions object can only be
454     used with the current context and other contexts that share with it.
455     Call initializeOpenGLFunctions() again to change the object's context
456     association.
457 */
458 void QOpenGLFunctions::initializeOpenGLFunctions()
459 {
460     d_ptr = qt_gl_functions();
461 }
462
463 /*!
464     \fn void QOpenGLFunctions::glActiveTexture(GLenum texture)
465
466     Convenience function that calls glActiveTexture(\a texture).
467
468     For more information, see the OpenGL/ES 2.0 documentation for
469     \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
470 */
471
472 /*!
473     \fn void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
474
475     Convenience function that calls glAttachShader(\a program, \a shader).
476
477     For more information, see the OpenGL/ES 2.0 documentation for
478     \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
479
480     This convenience function will do nothing on OpenGL/ES 1.x systems.
481 */
482
483 /*!
484     \fn void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
485
486     Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
487
488     For more information, see the OpenGL/ES 2.0 documentation for
489     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
490
491     This convenience function will do nothing on OpenGL/ES 1.x systems.
492 */
493
494 /*!
495     \fn void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
496
497     Convenience function that calls glBindBuffer(\a target, \a buffer).
498
499     For more information, see the OpenGL/ES 2.0 documentation for
500     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
501 */
502
503 /*!
504     \fn void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
505
506     Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
507
508     Note that Qt will translate a \a framebuffer argument of 0 to the currently
509     bound QOpenGLContext's defaultFramebufferObject().
510
511     For more information, see the OpenGL/ES 2.0 documentation for
512     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
513 */
514
515 /*!
516     \fn void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
517
518     Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
519
520     For more information, see the OpenGL/ES 2.0 documentation for
521     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
522 */
523
524 /*!
525     \fn void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
526
527     Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
528
529     For more information, see the OpenGL/ES 2.0 documentation for
530     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
531 */
532
533 /*!
534     \fn void QOpenGLFunctions::glBlendEquation(GLenum mode)
535
536     Convenience function that calls glBlendEquation(\a mode).
537
538     For more information, see the OpenGL/ES 2.0 documentation for
539     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
540 */
541
542 /*!
543     \fn void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
544
545     Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
546
547     For more information, see the OpenGL/ES 2.0 documentation for
548     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
549 */
550
551 /*!
552     \fn void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
553
554     Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
555
556     For more information, see the OpenGL/ES 2.0 documentation for
557     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
558 */
559
560 /*!
561     \fn void QOpenGLFunctions::glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
562
563     Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
564
565     For more information, see the OpenGL/ES 2.0 documentation for
566     \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
567 */
568
569 /*!
570     \fn void QOpenGLFunctions::glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
571
572     Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
573
574     For more information, see the OpenGL/ES 2.0 documentation for
575     \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
576 */
577
578 /*!
579     \fn GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
580
581     Convenience function that calls glCheckFramebufferStatus(\a target).
582
583     For more information, see the OpenGL/ES 2.0 documentation for
584     \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
585 */
586
587 /*!
588     \fn void QOpenGLFunctions::glClearDepthf(GLclampf depth)
589
590     Convenience function that calls glClearDepth(\a depth) on
591     desktop OpenGL systems and glClearDepthf(\a depth) on
592     embedded OpenGL/ES systems.
593
594     For more information, see the OpenGL/ES 2.0 documentation for
595     \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
596 */
597
598 /*!
599     \fn void QOpenGLFunctions::glCompileShader(GLuint shader)
600
601     Convenience function that calls glCompileShader(\a shader).
602
603     For more information, see the OpenGL/ES 2.0 documentation for
604     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
605
606     This convenience function will do nothing on OpenGL/ES 1.x systems.
607 */
608
609 /*!
610     \fn void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
611
612     Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
613
614     For more information, see the OpenGL/ES 2.0 documentation for
615     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
616 */
617
618 /*!
619     \fn void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
620
621     Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
622
623     For more information, see the OpenGL/ES 2.0 documentation for
624     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
625 */
626
627 /*!
628     \fn GLuint QOpenGLFunctions::glCreateProgram()
629
630     Convenience function that calls glCreateProgram().
631
632     For more information, see the OpenGL/ES 2.0 documentation for
633     \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
634
635     This convenience function will do nothing on OpenGL/ES 1.x systems.
636 */
637
638 /*!
639     \fn GLuint QOpenGLFunctions::glCreateShader(GLenum type)
640
641     Convenience function that calls glCreateShader(\a type).
642
643     For more information, see the OpenGL/ES 2.0 documentation for
644     \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
645
646     This convenience function will do nothing on OpenGL/ES 1.x systems.
647 */
648
649 /*!
650     \fn void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
651
652     Convenience function that calls glDeleteBuffers(\a n, \a buffers).
653
654     For more information, see the OpenGL/ES 2.0 documentation for
655     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
656 */
657
658 /*!
659     \fn void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
660
661     Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
662
663     For more information, see the OpenGL/ES 2.0 documentation for
664     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
665 */
666
667 /*!
668     \fn void QOpenGLFunctions::glDeleteProgram(GLuint program)
669
670     Convenience function that calls glDeleteProgram(\a program).
671
672     For more information, see the OpenGL/ES 2.0 documentation for
673     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
674
675     This convenience function will do nothing on OpenGL/ES 1.x systems.
676 */
677
678 /*!
679     \fn void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
680
681     Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
682
683     For more information, see the OpenGL/ES 2.0 documentation for
684     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
685 */
686
687 /*!
688     \fn void QOpenGLFunctions::glDeleteShader(GLuint shader)
689
690     Convenience function that calls glDeleteShader(\a shader).
691
692     For more information, see the OpenGL/ES 2.0 documentation for
693     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
694
695     This convenience function will do nothing on OpenGL/ES 1.x systems.
696 */
697
698 /*!
699     \fn void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
700
701     Convenience function that calls glDepthRange(\a zNear, \a zFar) on
702     desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
703     embedded OpenGL/ES systems.
704
705     For more information, see the OpenGL/ES 2.0 documentation for
706     \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
707 */
708
709 /*!
710     \fn void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
711
712     Convenience function that calls glDetachShader(\a program, \a shader).
713
714     For more information, see the OpenGL/ES 2.0 documentation for
715     \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
716
717     This convenience function will do nothing on OpenGL/ES 1.x systems.
718 */
719
720 /*!
721     \fn void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
722
723     Convenience function that calls glDisableVertexAttribArray(\a index).
724
725     For more information, see the OpenGL/ES 2.0 documentation for
726     \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
727
728     This convenience function will do nothing on OpenGL/ES 1.x systems.
729 */
730
731 /*!
732     \fn void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
733
734     Convenience function that calls glEnableVertexAttribArray(\a index).
735
736     For more information, see the OpenGL/ES 2.0 documentation for
737     \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
738
739     This convenience function will do nothing on OpenGL/ES 1.x systems.
740 */
741
742 /*!
743     \fn void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
744
745     Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
746
747     For more information, see the OpenGL/ES 2.0 documentation for
748     \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
749 */
750
751 /*!
752     \fn void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
753
754     Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
755
756     For more information, see the OpenGL/ES 2.0 documentation for
757     \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
758 */
759
760 /*!
761     \fn void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
762
763     Convenience function that calls glGenBuffers(\a n, \a buffers).
764
765     For more information, see the OpenGL/ES 2.0 documentation for
766     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
767 */
768
769 /*!
770     \fn void QOpenGLFunctions::glGenerateMipmap(GLenum target)
771
772     Convenience function that calls glGenerateMipmap(\a target).
773
774     For more information, see the OpenGL/ES 2.0 documentation for
775     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
776 */
777
778 /*!
779     \fn void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
780
781     Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
782
783     For more information, see the OpenGL/ES 2.0 documentation for
784     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
785 */
786
787 /*!
788     \fn void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
789
790     Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
791
792     For more information, see the OpenGL/ES 2.0 documentation for
793     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
794 */
795
796 /*!
797     \fn void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
798
799     Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
800
801     For more information, see the OpenGL/ES 2.0 documentation for
802     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
803
804     This convenience function will do nothing on OpenGL/ES 1.x systems.
805 */
806
807 /*!
808     \fn void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
809
810     Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
811
812     For more information, see the OpenGL/ES 2.0 documentation for
813     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
814
815     This convenience function will do nothing on OpenGL/ES 1.x systems.
816 */
817
818 /*!
819     \fn void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
820
821     Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
822
823     For more information, see the OpenGL/ES 2.0 documentation for
824     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
825
826     This convenience function will do nothing on OpenGL/ES 1.x systems.
827 */
828
829 /*!
830     \fn GLint QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
831
832     Convenience function that calls glGetAttribLocation(\a program, \a name).
833
834     For more information, see the OpenGL/ES 2.0 documentation for
835     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
836
837     This convenience function will do nothing on OpenGL/ES 1.x systems.
838 */
839
840 /*!
841     \fn void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
842
843     Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
844
845     For more information, see the OpenGL/ES 2.0 documentation for
846     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
847 */
848
849 /*!
850     \fn void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
851
852     Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
853
854     For more information, see the OpenGL/ES 2.0 documentation for
855     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
856 */
857
858 /*!
859     \fn void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
860
861     Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
862
863     For more information, see the OpenGL/ES 2.0 documentation for
864     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
865
866     This convenience function will do nothing on OpenGL/ES 1.x systems.
867 */
868
869 /*!
870     \fn void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
871
872     Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
873
874     For more information, see the OpenGL/ES 2.0 documentation for
875     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
876
877     This convenience function will do nothing on OpenGL/ES 1.x systems.
878 */
879
880 /*!
881     \fn void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
882
883     Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
884
885     For more information, see the OpenGL/ES 2.0 documentation for
886     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
887 */
888
889 /*!
890     \fn void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
891
892     Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
893
894     For more information, see the OpenGL/ES 2.0 documentation for
895     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
896
897     This convenience function will do nothing on OpenGL/ES 1.x systems.
898 */
899
900 /*!
901     \fn void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
902
903     Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
904
905     For more information, see the OpenGL/ES 2.0 documentation for
906     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
907
908     This convenience function will do nothing on OpenGL/ES 1.x systems.
909 */
910
911 /*!
912     \fn void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
913
914     Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
915
916     For more information, see the OpenGL/ES 2.0 documentation for
917     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
918
919     This convenience function will do nothing on OpenGL/ES 1.x systems.
920 */
921
922 /*!
923     \fn void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
924
925     Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
926
927     For more information, see the OpenGL/ES 2.0 documentation for
928     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
929
930     This convenience function will do nothing on OpenGL/ES 1.x systems.
931 */
932
933 /*!
934     \fn void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
935
936     Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
937
938     For more information, see the OpenGL/ES 2.0 documentation for
939     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
940
941     This convenience function will do nothing on OpenGL/ES 1.x systems.
942 */
943
944 /*!
945     \fn void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
946
947     Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
948
949     For more information, see the OpenGL/ES 2.0 documentation for
950     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
951
952     This convenience function will do nothing on OpenGL/ES 1.x systems.
953 */
954
955 /*!
956     \fn GLint QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
957
958     Convenience function that calls glGetUniformLocation(\a program, \a name).
959
960     For more information, see the OpenGL/ES 2.0 documentation for
961     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
962
963     This convenience function will do nothing on OpenGL/ES 1.x systems.
964 */
965
966 /*!
967     \fn void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
968
969     Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
970
971     For more information, see the OpenGL/ES 2.0 documentation for
972     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
973
974     This convenience function will do nothing on OpenGL/ES 1.x systems.
975 */
976
977 /*!
978     \fn void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
979
980     Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
981
982     For more information, see the OpenGL/ES 2.0 documentation for
983     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
984
985     This convenience function will do nothing on OpenGL/ES 1.x systems.
986 */
987
988 /*!
989     \fn void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
990
991     Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
992
993     For more information, see the OpenGL/ES 2.0 documentation for
994     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
995
996     This convenience function will do nothing on OpenGL/ES 1.x systems.
997 */
998
999 /*!
1000     \fn GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
1001
1002     Convenience function that calls glIsBuffer(\a buffer).
1003
1004     For more information, see the OpenGL/ES 2.0 documentation for
1005     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
1006 */
1007
1008 /*!
1009     \fn GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
1010
1011     Convenience function that calls glIsFramebuffer(\a framebuffer).
1012
1013     For more information, see the OpenGL/ES 2.0 documentation for
1014     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
1015 */
1016
1017 /*!
1018     \fn GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
1019
1020     Convenience function that calls glIsProgram(\a program).
1021
1022     For more information, see the OpenGL/ES 2.0 documentation for
1023     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
1024
1025     This convenience function will do nothing on OpenGL/ES 1.x systems.
1026 */
1027
1028 /*!
1029     \fn GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
1030
1031     Convenience function that calls glIsRenderbuffer(\a renderbuffer).
1032
1033     For more information, see the OpenGL/ES 2.0 documentation for
1034     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
1035 */
1036
1037 /*!
1038     \fn GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
1039
1040     Convenience function that calls glIsShader(\a shader).
1041
1042     For more information, see the OpenGL/ES 2.0 documentation for
1043     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
1044
1045     This convenience function will do nothing on OpenGL/ES 1.x systems.
1046 */
1047
1048 /*!
1049     \fn void QOpenGLFunctions::glLinkProgram(GLuint program)
1050
1051     Convenience function that calls glLinkProgram(\a program).
1052
1053     For more information, see the OpenGL/ES 2.0 documentation for
1054     \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
1055
1056     This convenience function will do nothing on OpenGL/ES 1.x systems.
1057 */
1058
1059 /*!
1060     \fn void QOpenGLFunctions::glReleaseShaderCompiler()
1061
1062     Convenience function that calls glReleaseShaderCompiler().
1063
1064     For more information, see the OpenGL/ES 2.0 documentation for
1065     \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
1066
1067     This convenience function will do nothing on OpenGL/ES 1.x systems.
1068 */
1069
1070 /*!
1071     \fn void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1072
1073     Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
1074
1075     For more information, see the OpenGL/ES 2.0 documentation for
1076     \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
1077 */
1078
1079 /*!
1080     \fn void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
1081
1082     Convenience function that calls glSampleCoverage(\a value, \a invert).
1083
1084     For more information, see the OpenGL/ES 2.0 documentation for
1085     \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
1086 */
1087
1088 /*!
1089     \fn void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
1090
1091     Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
1092
1093     For more information, see the OpenGL/ES 2.0 documentation for
1094     \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
1095
1096     This convenience function will do nothing on OpenGL/ES 1.x systems.
1097 */
1098
1099 /*!
1100     \fn void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
1101
1102     Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
1103
1104     For more information, see the OpenGL/ES 2.0 documentation for
1105     \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
1106
1107     This convenience function will do nothing on OpenGL/ES 1.x systems.
1108 */
1109
1110 /*!
1111     \fn void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1112
1113     Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1114
1115     For more information, see the OpenGL/ES 2.0 documentation for
1116     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1117 */
1118
1119 /*!
1120     \fn void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1121
1122     Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1123
1124     For more information, see the OpenGL/ES 2.0 documentation for
1125     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1126 */
1127
1128 /*!
1129     \fn void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1130
1131     Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1132
1133     For more information, see the OpenGL/ES 2.0 documentation for
1134     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1135 */
1136
1137 /*!
1138     \fn void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
1139
1140     Convenience function that calls glUniform1f(\a location, \a x).
1141
1142     For more information, see the OpenGL/ES 2.0 documentation for
1143     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1144
1145     This convenience function will do nothing on OpenGL/ES 1.x systems.
1146 */
1147
1148 /*!
1149     \fn void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1150
1151     Convenience function that calls glUniform1fv(\a location, \a count, \a v).
1152
1153     For more information, see the OpenGL/ES 2.0 documentation for
1154     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
1155
1156     This convenience function will do nothing on OpenGL/ES 1.x systems.
1157 */
1158
1159 /*!
1160     \fn void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
1161
1162     Convenience function that calls glUniform1i(\a location, \a x).
1163
1164     For more information, see the OpenGL/ES 2.0 documentation for
1165     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1166
1167     This convenience function will do nothing on OpenGL/ES 1.x systems.
1168 */
1169
1170 /*!
1171     \fn void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1172
1173     Convenience function that calls glUniform1iv(\a location, \a count, \a v).
1174
1175     For more information, see the OpenGL/ES 2.0 documentation for
1176     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
1177
1178     This convenience function will do nothing on OpenGL/ES 1.x systems.
1179 */
1180
1181 /*!
1182     \fn void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1183
1184     Convenience function that calls glUniform2f(\a location, \a x, \a y).
1185
1186     For more information, see the OpenGL/ES 2.0 documentation for
1187     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1188
1189     This convenience function will do nothing on OpenGL/ES 1.x systems.
1190 */
1191
1192 /*!
1193     \fn void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1194
1195     Convenience function that calls glUniform2fv(\a location, \a count, \a v).
1196
1197     For more information, see the OpenGL/ES 2.0 documentation for
1198     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
1199
1200     This convenience function will do nothing on OpenGL/ES 1.x systems.
1201 */
1202
1203 /*!
1204     \fn void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1205
1206     Convenience function that calls glUniform2i(\a location, \a x, \a y).
1207
1208     For more information, see the OpenGL/ES 2.0 documentation for
1209     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1210
1211     This convenience function will do nothing on OpenGL/ES 1.x systems.
1212 */
1213
1214 /*!
1215     \fn void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1216
1217     Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1218
1219     For more information, see the OpenGL/ES 2.0 documentation for
1220     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1221
1222     This convenience function will do nothing on OpenGL/ES 1.x systems.
1223 */
1224
1225 /*!
1226     \fn void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1227
1228     Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1229
1230     For more information, see the OpenGL/ES 2.0 documentation for
1231     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1232
1233     This convenience function will do nothing on OpenGL/ES 1.x systems.
1234 */
1235
1236 /*!
1237     \fn void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1238
1239     Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1240
1241     For more information, see the OpenGL/ES 2.0 documentation for
1242     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1243
1244     This convenience function will do nothing on OpenGL/ES 1.x systems.
1245 */
1246
1247 /*!
1248     \fn void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1249
1250     Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1251
1252     For more information, see the OpenGL/ES 2.0 documentation for
1253     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1254
1255     This convenience function will do nothing on OpenGL/ES 1.x systems.
1256 */
1257
1258 /*!
1259     \fn void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1260
1261     Convenience function that calls glUniform3iv(\a location, \a count, \a v).
1262
1263     For more information, see the OpenGL/ES 2.0 documentation for
1264     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
1265
1266     This convenience function will do nothing on OpenGL/ES 1.x systems.
1267 */
1268
1269 /*!
1270     \fn void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1271
1272     Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1273
1274     For more information, see the OpenGL/ES 2.0 documentation for
1275     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1276
1277     This convenience function will do nothing on OpenGL/ES 1.x systems.
1278 */
1279
1280 /*!
1281     \fn void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1282
1283     Convenience function that calls glUniform4fv(\a location, \a count, \a v).
1284
1285     For more information, see the OpenGL/ES 2.0 documentation for
1286     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
1287
1288     This convenience function will do nothing on OpenGL/ES 1.x systems.
1289 */
1290
1291 /*!
1292     \fn void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1293
1294     Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1295
1296     For more information, see the OpenGL/ES 2.0 documentation for
1297     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1298
1299     This convenience function will do nothing on OpenGL/ES 1.x systems.
1300 */
1301
1302 /*!
1303     \fn void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1304
1305     Convenience function that calls glUniform4iv(\a location, \a count, \a v).
1306
1307     For more information, see the OpenGL/ES 2.0 documentation for
1308     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
1309
1310     This convenience function will do nothing on OpenGL/ES 1.x systems.
1311 */
1312
1313 /*!
1314     \fn void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1315
1316     Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1317
1318     For more information, see the OpenGL/ES 2.0 documentation for
1319     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1320
1321     This convenience function will do nothing on OpenGL/ES 1.x systems.
1322 */
1323
1324 /*!
1325     \fn void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1326
1327     Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1328
1329     For more information, see the OpenGL/ES 2.0 documentation for
1330     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1331
1332     This convenience function will do nothing on OpenGL/ES 1.x systems.
1333 */
1334
1335 /*!
1336     \fn void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1337
1338     Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1339
1340     For more information, see the OpenGL/ES 2.0 documentation for
1341     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1342
1343     This convenience function will do nothing on OpenGL/ES 1.x systems.
1344 */
1345
1346 /*!
1347     \fn void QOpenGLFunctions::glUseProgram(GLuint program)
1348
1349     Convenience function that calls glUseProgram(\a program).
1350
1351     For more information, see the OpenGL/ES 2.0 documentation for
1352     \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1353
1354     This convenience function will do nothing on OpenGL/ES 1.x systems.
1355 */
1356
1357 /*!
1358     \fn void QOpenGLFunctions::glValidateProgram(GLuint program)
1359
1360     Convenience function that calls glValidateProgram(\a program).
1361
1362     For more information, see the OpenGL/ES 2.0 documentation for
1363     \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1364
1365     This convenience function will do nothing on OpenGL/ES 1.x systems.
1366 */
1367
1368 /*!
1369     \fn void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1370
1371     Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1372
1373     For more information, see the OpenGL/ES 2.0 documentation for
1374     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1375
1376     This convenience function will do nothing on OpenGL/ES 1.x systems.
1377 */
1378
1379 /*!
1380     \fn void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1381
1382     Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1383
1384     For more information, see the OpenGL/ES 2.0 documentation for
1385     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1386
1387     This convenience function will do nothing on OpenGL/ES 1.x systems.
1388 */
1389
1390 /*!
1391     \fn void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1392
1393     Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1394
1395     For more information, see the OpenGL/ES 2.0 documentation for
1396     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1397
1398     This convenience function will do nothing on OpenGL/ES 1.x systems.
1399 */
1400
1401 /*!
1402     \fn void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1403
1404     Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1405
1406     For more information, see the OpenGL/ES 2.0 documentation for
1407     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1408
1409     This convenience function will do nothing on OpenGL/ES 1.x systems.
1410 */
1411
1412 /*!
1413     \fn void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1414
1415     Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1416
1417     For more information, see the OpenGL/ES 2.0 documentation for
1418     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1419
1420     This convenience function will do nothing on OpenGL/ES 1.x systems.
1421 */
1422
1423 /*!
1424     \fn void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1425
1426     Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1427
1428     For more information, see the OpenGL/ES 2.0 documentation for
1429     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1430
1431     This convenience function will do nothing on OpenGL/ES 1.x systems.
1432 */
1433
1434 /*!
1435     \fn void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1436
1437     Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1438
1439     For more information, see the OpenGL/ES 2.0 documentation for
1440     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1441
1442     This convenience function will do nothing on OpenGL/ES 1.x systems.
1443 */
1444
1445 /*!
1446     \fn void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1447
1448     Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1449
1450     For more information, see the OpenGL/ES 2.0 documentation for
1451     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1452
1453     This convenience function will do nothing on OpenGL/ES 1.x systems.
1454 */
1455
1456 /*!
1457     \fn void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1458
1459     Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1460
1461     For more information, see the OpenGL/ES 2.0 documentation for
1462     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1463
1464     This convenience function will do nothing on OpenGL/ES 1.x systems.
1465 */
1466
1467 /*!
1468     \fn bool QOpenGLFunctions::isInitialized(const QOpenGLFunctionsPrivate *d)
1469     \internal
1470 */
1471
1472 namespace {
1473
1474 enum ResolvePolicy
1475 {
1476     ResolveOES = 0x1,
1477     ResolveEXT = 0x2
1478 };
1479
1480 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1481 class Resolver
1482 {
1483 public:
1484     Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1485         : funcPointerName(func)
1486         , fallbackFuncPointer(fallback)
1487         , funcName(name)
1488         , alternateFuncName(alternateName)
1489     {
1490     }
1491
1492     ReturnType operator()();
1493
1494     template <typename P1>
1495     ReturnType operator()(P1 p1);
1496
1497     template <typename P1, typename P2>
1498     ReturnType operator()(P1 p1, P2 p2);
1499
1500     template <typename P1, typename P2, typename P3>
1501     ReturnType operator()(P1 p1, P2 p2, P3 p3);
1502
1503     template <typename P1, typename P2, typename P3, typename P4>
1504     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1505
1506     template <typename P1, typename P2, typename P3, typename P4, typename P5>
1507     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1508
1509     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1510     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1511
1512     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1513     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1514
1515     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1516     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1517
1518     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1519     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1520
1521     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1522     ReturnType operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1523
1524 private:
1525     FuncType Base::*funcPointerName;
1526     FuncType fallbackFuncPointer;
1527     QByteArray funcName;
1528     QByteArray alternateFuncName;
1529 };
1530
1531 template <typename Base, typename FuncType, int Policy>
1532 class Resolver<Base, FuncType, Policy, void>
1533 {
1534 public:
1535     Resolver(FuncType Base::*func, FuncType fallback, const char *name, const char *alternateName = 0)
1536         : funcPointerName(func)
1537         , fallbackFuncPointer(fallback)
1538         , funcName(name)
1539         , alternateFuncName(alternateName)
1540     {
1541     }
1542
1543     void operator()();
1544
1545     template <typename P1>
1546     void operator()(P1 p1);
1547
1548     template <typename P1, typename P2>
1549     void operator()(P1 p1, P2 p2);
1550
1551     template <typename P1, typename P2, typename P3>
1552     void operator()(P1 p1, P2 p2, P3 p3);
1553
1554     template <typename P1, typename P2, typename P3, typename P4>
1555     void operator()(P1 p1, P2 p2, P3 p3, P4 p4);
1556
1557     template <typename P1, typename P2, typename P3, typename P4, typename P5>
1558     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
1559
1560     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1561     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
1562
1563     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1564     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7);
1565
1566     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1567     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8);
1568
1569     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1570     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9);
1571
1572     template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1573     void operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10);
1574
1575 private:
1576     FuncType Base::*funcPointerName;
1577     FuncType fallbackFuncPointer;
1578     QByteArray funcName;
1579     QByteArray alternateFuncName;
1580 };
1581
1582 #define RESOLVER_COMMON \
1583     QOpenGLContext *context = QOpenGLContext::currentContext(); \
1584     Base *funcs = qt_gl_functions(context); \
1585  \
1586     FuncType old = funcs->*funcPointerName; \
1587  \
1588     funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName); \
1589  \
1590     if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1591         funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "OES"); \
1592  \
1593     if (!(funcs->*funcPointerName)) \
1594         funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "ARB"); \
1595  \
1596     if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1597         funcs->*funcPointerName = (FuncType)context->getProcAddress(funcName + "EXT"); \
1598  \
1599     if (!alternateFuncName.isEmpty() && !(funcs->*funcPointerName)) { \
1600         funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName); \
1601  \
1602         if ((Policy & ResolveOES) && !(funcs->*funcPointerName)) \
1603             funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "OES"); \
1604  \
1605         if (!(funcs->*funcPointerName)) \
1606             funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "ARB"); \
1607  \
1608         if ((Policy & ResolveEXT) && !(funcs->*funcPointerName)) \
1609             funcs->*funcPointerName = (FuncType)context->getProcAddress(alternateFuncName + "EXT"); \
1610     }
1611
1612 #define RESOLVER_COMMON_NON_VOID \
1613     RESOLVER_COMMON \
1614  \
1615     if (!(funcs->*funcPointerName)) { \
1616         if (fallbackFuncPointer) { \
1617             funcs->*funcPointerName = fallbackFuncPointer; \
1618         } else { \
1619             funcs->*funcPointerName = old; \
1620             return ReturnType(); \
1621         } \
1622     }
1623
1624 #define RESOLVER_COMMON_VOID \
1625     RESOLVER_COMMON \
1626  \
1627     if (!(funcs->*funcPointerName)) { \
1628         if (fallbackFuncPointer) { \
1629             funcs->*funcPointerName = fallbackFuncPointer; \
1630         } else { \
1631             funcs->*funcPointerName = old; \
1632             return; \
1633         } \
1634     }
1635
1636 template <typename Base, typename FuncType, int Policy, typename ReturnType>
1637 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()()
1638 {
1639     RESOLVER_COMMON_NON_VOID
1640
1641     return (funcs->*funcPointerName)();
1642 }
1643
1644 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1>
1645 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1)
1646 {
1647     RESOLVER_COMMON_NON_VOID
1648
1649     return (funcs->*funcPointerName)(p1);
1650 }
1651
1652 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2>
1653 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2)
1654 {
1655     RESOLVER_COMMON_NON_VOID
1656
1657     return (funcs->*funcPointerName)(p1, p2);
1658 }
1659
1660 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3>
1661 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3)
1662 {
1663     RESOLVER_COMMON_NON_VOID
1664
1665     return (funcs->*funcPointerName)(p1, p2, p3);
1666 }
1667
1668 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4>
1669 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1670 {
1671     RESOLVER_COMMON_NON_VOID
1672
1673     return (funcs->*funcPointerName)(p1, p2, p3, p4);
1674 }
1675
1676 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1677 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1678 {
1679     RESOLVER_COMMON_NON_VOID
1680
1681     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1682 }
1683
1684 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1685 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1686 {
1687     RESOLVER_COMMON_NON_VOID
1688
1689     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1690 }
1691
1692 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1693 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1694 {
1695     RESOLVER_COMMON_NON_VOID
1696
1697     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1698 }
1699
1700 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1701 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1702 {
1703     RESOLVER_COMMON_NON_VOID
1704
1705     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1706 }
1707
1708 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1709 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
1710 {
1711     RESOLVER_COMMON_NON_VOID
1712
1713     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1714 }
1715
1716 template <typename Base, typename FuncType, int Policy, typename ReturnType> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1717 ReturnType Resolver<Base, FuncType, Policy, ReturnType>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
1718 {
1719     RESOLVER_COMMON_NON_VOID
1720
1721     return (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1722 }
1723
1724 template <typename Base, typename FuncType, int Policy>
1725 void Resolver<Base, FuncType, Policy, void>::operator()()
1726 {
1727     RESOLVER_COMMON_VOID
1728
1729     (funcs->*funcPointerName)();
1730 }
1731
1732 template <typename Base, typename FuncType, int Policy> template <typename P1>
1733 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1)
1734 {
1735     RESOLVER_COMMON_VOID
1736
1737     (funcs->*funcPointerName)(p1);
1738 }
1739
1740 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2>
1741 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2)
1742 {
1743     RESOLVER_COMMON_VOID
1744
1745     (funcs->*funcPointerName)(p1, p2);
1746 }
1747
1748 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3>
1749 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3)
1750 {
1751     RESOLVER_COMMON_VOID
1752
1753     (funcs->*funcPointerName)(p1, p2, p3);
1754 }
1755
1756 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4>
1757 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4)
1758 {
1759     RESOLVER_COMMON_VOID
1760
1761     (funcs->*funcPointerName)(p1, p2, p3, p4);
1762 }
1763
1764 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5>
1765 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
1766 {
1767     RESOLVER_COMMON_VOID
1768
1769     (funcs->*funcPointerName)(p1, p2, p3, p4, p5);
1770 }
1771
1772 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
1773 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
1774 {
1775     RESOLVER_COMMON_VOID
1776
1777     (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6);
1778 }
1779
1780 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
1781 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
1782 {
1783     RESOLVER_COMMON_VOID
1784
1785     (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7);
1786 }
1787
1788 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
1789 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
1790 {
1791     RESOLVER_COMMON_VOID
1792
1793     (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8);
1794 }
1795
1796 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
1797 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
1798 {
1799     RESOLVER_COMMON_VOID
1800
1801     (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9);
1802 }
1803
1804 template <typename Base, typename FuncType, int Policy> template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
1805 void Resolver<Base, FuncType, Policy, void>::operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
1806 {
1807     RESOLVER_COMMON_VOID
1808
1809     (funcs->*funcPointerName)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
1810 }
1811
1812 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1813 Resolver<Base, FuncType, Policy, ReturnType> functionResolverWithFallback(FuncType Base::*func, FuncType fallback, const char *name, const char *alternate = 0)
1814 {
1815     return Resolver<Base, FuncType, Policy, ReturnType>(func, fallback, name, alternate);
1816 }
1817
1818 template <typename ReturnType, int Policy, typename Base, typename FuncType>
1819 Resolver<Base, FuncType, Policy, ReturnType> functionResolver(FuncType Base::*func, const char *name, const char *alternate = 0)
1820 {
1821     return Resolver<Base, FuncType, Policy, ReturnType>(func, 0, name, alternate);
1822 }
1823
1824 }
1825
1826 #define RESOLVE_FUNC(RETURN_TYPE, POLICY, NAME) \
1827     return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1828
1829 #define RESOLVE_FUNC_VOID(POLICY, NAME) \
1830     functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME)
1831
1832 #define RESOLVE_FUNC_SPECIAL(RETURN_TYPE, POLICY, NAME) \
1833     return functionResolverWithFallback<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1834
1835 #define RESOLVE_FUNC_SPECIAL_VOID(POLICY, NAME) \
1836     functionResolverWithFallback<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, qopenglfSpecial##NAME, "gl" #NAME)
1837
1838 #define RESOLVE_FUNC_WITH_ALTERNATE(RETURN_TYPE, POLICY, NAME, ALTERNATE) \
1839     return functionResolver<RETURN_TYPE, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1840
1841 #define RESOLVE_FUNC_VOID_WITH_ALTERNATE(POLICY, NAME, ALTERNATE) \
1842     functionResolver<void, POLICY>(&QOpenGLExtensionsPrivate::NAME, "gl" #NAME, "gl" #ALTERNATE)
1843
1844 #ifndef QT_OPENGL_ES_2
1845
1846 static void QOPENGLF_APIENTRY qopenglfResolveActiveTexture(GLenum texture)
1847 {
1848     RESOLVE_FUNC_VOID(0, ActiveTexture)(texture);
1849 }
1850
1851 static void QOPENGLF_APIENTRY qopenglfResolveAttachShader(GLuint program, GLuint shader)
1852 {
1853     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, AttachShader, AttachObject)(program, shader);
1854 }
1855
1856 static void QOPENGLF_APIENTRY qopenglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1857 {
1858     RESOLVE_FUNC_VOID(0, BindAttribLocation)(program, index, name);
1859 }
1860
1861 static void QOPENGLF_APIENTRY qopenglfResolveBindBuffer(GLenum target, GLuint buffer)
1862 {
1863     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindBuffer)(target, buffer);
1864 }
1865
1866 static void QOPENGLF_APIENTRY qopenglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1867 {
1868     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindFramebuffer)(target, framebuffer);
1869 }
1870
1871 static void QOPENGLF_APIENTRY qopenglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1872 {
1873     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BindRenderbuffer)(target, renderbuffer);
1874 }
1875
1876 static void QOPENGLF_APIENTRY qopenglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1877 {
1878     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendColor)(red, green, blue, alpha);
1879 }
1880
1881 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquation(GLenum mode)
1882 {
1883     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquation)(mode);
1884 }
1885
1886 static void QOPENGLF_APIENTRY qopenglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1887 {
1888     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendEquationSeparate)(modeRGB, modeAlpha);
1889 }
1890
1891 static void QOPENGLF_APIENTRY qopenglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1892 {
1893     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BlendFuncSeparate)(srcRGB, dstRGB, srcAlpha, dstAlpha);
1894 }
1895
1896 static void QOPENGLF_APIENTRY qopenglfResolveBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
1897 {
1898     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferData)(target, size, data, usage);
1899 }
1900
1901 static void QOPENGLF_APIENTRY qopenglfResolveBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
1902 {
1903     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, BufferSubData)(target, offset, size, data);
1904 }
1905
1906 static GLenum QOPENGLF_APIENTRY qopenglfResolveCheckFramebufferStatus(GLenum target)
1907 {
1908     RESOLVE_FUNC(GLenum, ResolveOES | ResolveEXT, CheckFramebufferStatus)(target);
1909 }
1910
1911 static void QOPENGLF_APIENTRY qopenglfResolveCompileShader(GLuint shader)
1912 {
1913     RESOLVE_FUNC_VOID(0, CompileShader)(shader);
1914 }
1915
1916 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1917 {
1918     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexImage2D)(target, level, internalformat, width, height, border, imageSize, data);
1919 }
1920
1921 static void QOPENGLF_APIENTRY qopenglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1922 {
1923     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, CompressedTexSubImage2D)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1924 }
1925
1926 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateProgram()
1927 {
1928     RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateProgram, CreateProgramObject)();
1929 }
1930
1931 static GLuint QOPENGLF_APIENTRY qopenglfResolveCreateShader(GLenum type)
1932 {
1933     RESOLVE_FUNC_WITH_ALTERNATE(GLuint, 0, CreateShader, CreateShaderObject)(type);
1934 }
1935
1936 static void QOPENGLF_APIENTRY qopenglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1937 {
1938     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteBuffers)(n, buffers);
1939 }
1940
1941 static void QOPENGLF_APIENTRY qopenglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1942 {
1943     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteFramebuffers)(n, framebuffers);
1944 }
1945
1946 static void QOPENGLF_APIENTRY qopenglfResolveDeleteProgram(GLuint program)
1947 {
1948     RESOLVE_FUNC_VOID(0, DeleteProgram)(program);
1949 }
1950
1951 static void QOPENGLF_APIENTRY qopenglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1952 {
1953     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, DeleteRenderbuffers)(n, renderbuffers);
1954 }
1955
1956 static void QOPENGLF_APIENTRY qopenglfResolveDeleteShader(GLuint shader)
1957 {
1958     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DeleteShader, DeleteObject)(shader);
1959 }
1960
1961 static void QOPENGLF_APIENTRY qopenglfResolveDetachShader(GLuint program, GLuint shader)
1962 {
1963     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, DetachShader, DetachObject)(program, shader);
1964 }
1965
1966 static void QOPENGLF_APIENTRY qopenglfResolveDisableVertexAttribArray(GLuint index)
1967 {
1968     RESOLVE_FUNC_VOID(0, DisableVertexAttribArray)(index);
1969 }
1970
1971 static void QOPENGLF_APIENTRY qopenglfResolveEnableVertexAttribArray(GLuint index)
1972 {
1973     RESOLVE_FUNC_VOID(0, EnableVertexAttribArray)(index);
1974 }
1975
1976 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1977 {
1978     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferRenderbuffer)(target, attachment, renderbuffertarget, renderbuffer);
1979 }
1980
1981 static void QOPENGLF_APIENTRY qopenglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1982 {
1983     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, FramebufferTexture2D)(target, attachment, textarget, texture, level);
1984 }
1985
1986 static void QOPENGLF_APIENTRY qopenglfResolveGenBuffers(GLsizei n, GLuint* buffers)
1987 {
1988     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenBuffers)(n, buffers);
1989 }
1990
1991 static void QOPENGLF_APIENTRY qopenglfResolveGenerateMipmap(GLenum target)
1992 {
1993     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenerateMipmap)(target);
1994 }
1995
1996 static void QOPENGLF_APIENTRY qopenglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
1997 {
1998     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenFramebuffers)(n, framebuffers);
1999 }
2000
2001 static void QOPENGLF_APIENTRY qopenglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2002 {
2003     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GenRenderbuffers)(n, renderbuffers);
2004 }
2005
2006 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2007 {
2008     RESOLVE_FUNC_VOID(0, GetActiveAttrib)(program, index, bufsize, length, size, type, name);
2009 }
2010
2011 static void QOPENGLF_APIENTRY qopenglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2012 {
2013     RESOLVE_FUNC_VOID(0, GetActiveUniform)(program, index, bufsize, length, size, type, name);
2014 }
2015
2016 static void QOPENGLF_APIENTRY qopenglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2017 {
2018     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetAttachedShaders, GetAttachedObjects)(program, maxcount, count, shaders);
2019 }
2020
2021 static GLint QOPENGLF_APIENTRY qopenglfResolveGetAttribLocation(GLuint program, const char* name)
2022 {
2023     RESOLVE_FUNC(GLint, 0, GetAttribLocation)(program, name);
2024 }
2025
2026 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2027 {
2028     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetBufferParameteriv)(target, pname, params);
2029 }
2030
2031 static void QOPENGLF_APIENTRY qopenglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2032 {
2033     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetFramebufferAttachmentParameteriv)(target, attachment, pname, params);
2034 }
2035
2036 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2037 {
2038     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramiv, GetObjectParameteriv)(program, pname, params);
2039 }
2040
2041 static void QOPENGLF_APIENTRY qopenglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2042 {
2043     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetProgramInfoLog, GetInfoLog)(program, bufsize, length, infolog);
2044 }
2045
2046 static void QOPENGLF_APIENTRY qopenglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2047 {
2048     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, GetRenderbufferParameteriv)(target, pname, params);
2049 }
2050
2051 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2052 {
2053     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderiv, GetObjectParameteriv)(shader, pname, params);
2054 }
2055
2056 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2057 {
2058     RESOLVE_FUNC_VOID_WITH_ALTERNATE(0, GetShaderInfoLog, GetInfoLog)(shader, bufsize, length, infolog);
2059 }
2060
2061 static void QOPENGLF_APIENTRY qopenglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2062 {
2063     Q_UNUSED(shadertype);
2064     Q_UNUSED(precisiontype);
2065     range[0] = range[1] = precision[0] = 0;
2066 }
2067
2068 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2069 {
2070     RESOLVE_FUNC_SPECIAL_VOID(ResolveOES | ResolveEXT, GetShaderPrecisionFormat)(shadertype, precisiontype, range, precision);
2071 }
2072
2073 static void QOPENGLF_APIENTRY qopenglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2074 {
2075     RESOLVE_FUNC_VOID(0, GetShaderSource)(shader, bufsize, length, source);
2076 }
2077
2078 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2079 {
2080     RESOLVE_FUNC_VOID(0, GetUniformfv)(program, location, params);
2081 }
2082
2083 static void QOPENGLF_APIENTRY qopenglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2084 {
2085     RESOLVE_FUNC_VOID(0, GetUniformiv)(program, location, params);
2086 }
2087
2088 static GLint QOPENGLF_APIENTRY qopenglfResolveGetUniformLocation(GLuint program, const char* name)
2089 {
2090     RESOLVE_FUNC(GLint, 0, GetUniformLocation)(program, name);
2091 }
2092
2093 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2094 {
2095     RESOLVE_FUNC_VOID(0, GetVertexAttribfv)(index, pname, params);
2096 }
2097
2098 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2099 {
2100     RESOLVE_FUNC_VOID(0, GetVertexAttribiv)(index, pname, params);
2101 }
2102
2103 static void QOPENGLF_APIENTRY qopenglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2104 {
2105     RESOLVE_FUNC_VOID(0, GetVertexAttribPointerv)(index, pname, pointer);
2106 }
2107
2108 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsBuffer(GLuint buffer)
2109 {
2110     RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsBuffer)(buffer);
2111 }
2112
2113 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsFramebuffer(GLuint framebuffer)
2114 {
2115     RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsFramebuffer)(framebuffer);
2116 }
2117
2118 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsProgram(GLuint program)
2119 {
2120     return program != 0;
2121 }
2122
2123 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsProgram(GLuint program)
2124 {
2125     RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsProgram)(program);
2126 }
2127
2128 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsRenderbuffer(GLuint renderbuffer)
2129 {
2130     RESOLVE_FUNC(GLboolean, ResolveOES | ResolveEXT, IsRenderbuffer)(renderbuffer);
2131 }
2132
2133 static GLboolean QOPENGLF_APIENTRY qopenglfSpecialIsShader(GLuint shader)
2134 {
2135     return shader != 0;
2136 }
2137
2138 static GLboolean QOPENGLF_APIENTRY qopenglfResolveIsShader(GLuint shader)
2139 {
2140     RESOLVE_FUNC_SPECIAL(GLboolean, 0, IsShader)(shader);
2141 }
2142
2143 static void QOPENGLF_APIENTRY qopenglfResolveLinkProgram(GLuint program)
2144 {
2145     RESOLVE_FUNC_VOID(0, LinkProgram)(program);
2146 }
2147
2148 static void QOPENGLF_APIENTRY qopenglfSpecialReleaseShaderCompiler()
2149 {
2150 }
2151
2152 static void QOPENGLF_APIENTRY qopenglfResolveReleaseShaderCompiler()
2153 {
2154     RESOLVE_FUNC_SPECIAL_VOID(0, ReleaseShaderCompiler)();
2155 }
2156
2157 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2158 {
2159     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, RenderbufferStorage)(target, internalformat, width, height);
2160 }
2161
2162 static void QOPENGLF_APIENTRY qopenglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2163 {
2164     RESOLVE_FUNC_VOID(ResolveOES | ResolveEXT, SampleCoverage)(value, invert);
2165 }
2166
2167 static void QOPENGLF_APIENTRY qopenglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2168 {
2169     RESOLVE_FUNC_VOID(0, ShaderBinary)(n, shaders, binaryformat, binary, length);
2170 }
2171
2172 static void QOPENGLF_APIENTRY qopenglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2173 {
2174     RESOLVE_FUNC_VOID(0, ShaderSource)(shader, count, string, length);
2175 }
2176
2177 static void QOPENGLF_APIENTRY qopenglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2178 {
2179     RESOLVE_FUNC_VOID(ResolveEXT, StencilFuncSeparate)(face, func, ref, mask);
2180 }
2181
2182 static void QOPENGLF_APIENTRY qopenglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2183 {
2184     RESOLVE_FUNC_VOID(ResolveEXT, StencilMaskSeparate)(face, mask);
2185 }
2186
2187 static void QOPENGLF_APIENTRY qopenglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2188 {
2189     RESOLVE_FUNC_VOID(ResolveEXT, StencilOpSeparate)(face, fail, zfail, zpass);
2190 }
2191
2192 static void QOPENGLF_APIENTRY qopenglfResolveUniform1f(GLint location, GLfloat x)
2193 {
2194     RESOLVE_FUNC_VOID(0, Uniform1f)(location, x);
2195 }
2196
2197 static void QOPENGLF_APIENTRY qopenglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
2198 {
2199     RESOLVE_FUNC_VOID(0, Uniform1fv)(location, count, v);
2200 }
2201
2202 static void QOPENGLF_APIENTRY qopenglfResolveUniform1i(GLint location, GLint x)
2203 {
2204     RESOLVE_FUNC_VOID(0, Uniform1i)(location, x);
2205 }
2206
2207 static void QOPENGLF_APIENTRY qopenglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
2208 {
2209     RESOLVE_FUNC_VOID(0, Uniform1iv)(location, count, v);
2210 }
2211
2212 static void QOPENGLF_APIENTRY qopenglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
2213 {
2214     RESOLVE_FUNC_VOID(0, Uniform2f)(location, x, y);
2215 }
2216
2217 static void QOPENGLF_APIENTRY qopenglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
2218 {
2219     RESOLVE_FUNC_VOID(0, Uniform2fv)(location, count, v);
2220 }
2221
2222 static void QOPENGLF_APIENTRY qopenglfResolveUniform2i(GLint location, GLint x, GLint y)
2223 {
2224     RESOLVE_FUNC_VOID(0, Uniform2i)(location, x, y);
2225 }
2226
2227 static void QOPENGLF_APIENTRY qopenglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
2228 {
2229     RESOLVE_FUNC_VOID(0, Uniform2iv)(location, count, v);
2230 }
2231
2232 static void QOPENGLF_APIENTRY qopenglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
2233 {
2234     RESOLVE_FUNC_VOID(0, Uniform3f)(location, x, y, z);
2235 }
2236
2237 static void QOPENGLF_APIENTRY qopenglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
2238 {
2239     RESOLVE_FUNC_VOID(0, Uniform3fv)(location, count, v);
2240 }
2241
2242 static void QOPENGLF_APIENTRY qopenglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
2243 {
2244     RESOLVE_FUNC_VOID(0, Uniform3i)(location, x, y, z);
2245 }
2246
2247 static void QOPENGLF_APIENTRY qopenglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
2248 {
2249     RESOLVE_FUNC_VOID(0, Uniform3iv)(location, count, v);
2250 }
2251
2252 static void QOPENGLF_APIENTRY qopenglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2253 {
2254     RESOLVE_FUNC_VOID(0, Uniform4f)(location, x, y, z, w);
2255 }
2256
2257 static void QOPENGLF_APIENTRY qopenglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
2258 {
2259     RESOLVE_FUNC_VOID(0, Uniform4fv)(location, count, v);
2260 }
2261
2262 static void QOPENGLF_APIENTRY qopenglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
2263 {
2264     RESOLVE_FUNC_VOID(0, Uniform4i)(location, x, y, z, w);
2265 }
2266
2267 static void QOPENGLF_APIENTRY qopenglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
2268 {
2269     RESOLVE_FUNC_VOID(0, Uniform4iv)(location, count, v);
2270 }
2271
2272 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2273 {
2274     RESOLVE_FUNC_VOID(0, UniformMatrix2fv)(location, count, transpose, value);
2275 }
2276
2277 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2278 {
2279     RESOLVE_FUNC_VOID(0, UniformMatrix3fv)(location, count, transpose, value);
2280 }
2281
2282 static void QOPENGLF_APIENTRY qopenglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2283 {
2284     RESOLVE_FUNC_VOID(0, UniformMatrix4fv)(location, count, transpose, value);
2285 }
2286
2287 static void QOPENGLF_APIENTRY qopenglfResolveUseProgram(GLuint program)
2288 {
2289     RESOLVE_FUNC_VOID(0, UseProgram)(program);
2290 }
2291
2292 static void QOPENGLF_APIENTRY qopenglfResolveValidateProgram(GLuint program)
2293 {
2294     RESOLVE_FUNC_VOID(0, ValidateProgram)(program);
2295 }
2296
2297 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
2298 {
2299     RESOLVE_FUNC_VOID(0, VertexAttrib1f)(indx, x);
2300 }
2301
2302 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
2303 {
2304     RESOLVE_FUNC_VOID(0, VertexAttrib1fv)(indx, values);
2305 }
2306
2307 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
2308 {
2309     RESOLVE_FUNC_VOID(0, VertexAttrib2f)(indx, x, y);
2310 }
2311
2312 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
2313 {
2314     RESOLVE_FUNC_VOID(0, VertexAttrib2fv)(indx, values);
2315 }
2316
2317 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
2318 {
2319     RESOLVE_FUNC_VOID(0, VertexAttrib3f)(indx, x, y, z);
2320 }
2321
2322 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
2323 {
2324     RESOLVE_FUNC_VOID(0, VertexAttrib3fv)(indx, values);
2325 }
2326
2327 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2328 {
2329     RESOLVE_FUNC_VOID(0, VertexAttrib4f)(indx, x, y, z, w);
2330 }
2331
2332 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
2333 {
2334     RESOLVE_FUNC_VOID(0, VertexAttrib4fv)(indx, values);
2335 }
2336
2337 static void QOPENGLF_APIENTRY qopenglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
2338 {
2339     RESOLVE_FUNC_VOID(0, VertexAttribPointer)(indx, size, type, normalized, stride, ptr);
2340 }
2341
2342 #endif // !QT_OPENGL_ES_2
2343
2344 static GLvoid *QOPENGLF_APIENTRY qopenglfResolveMapBuffer(GLenum target, GLenum access)
2345 {
2346     RESOLVE_FUNC(GLvoid *, ResolveOES, MapBuffer)(target, access);
2347 }
2348
2349 static GLboolean QOPENGLF_APIENTRY qopenglfResolveUnmapBuffer(GLenum target)
2350 {
2351     RESOLVE_FUNC(GLboolean, ResolveOES, UnmapBuffer)(target);
2352 }
2353
2354 static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
2355                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
2356                        GLbitfield mask, GLenum filter)
2357 {
2358     RESOLVE_FUNC_VOID(ResolveEXT, BlitFramebuffer)
2359         (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
2360 }
2361
2362 static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples,
2363                                       GLenum internalFormat,
2364                                       GLsizei width, GLsizei height)
2365 {
2366     RESOLVE_FUNC_VOID(ResolveEXT, RenderbufferStorageMultisample)
2367         (target, samples, internalFormat, width, height);
2368 }
2369
2370 static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)
2371 {
2372     RESOLVE_FUNC_VOID(ResolveEXT, GetBufferSubData)
2373         (target, offset, size, data);
2374 }
2375
2376 QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(QOpenGLContext *)
2377 {
2378     /* Assign a pointer to an above defined static function
2379      * which on first call resolves the function from the current
2380      * context, assigns it to the member variable and executes it
2381      * (see Resolver template) */
2382 #ifndef QT_OPENGL_ES_2
2383     ActiveTexture = qopenglfResolveActiveTexture;
2384     AttachShader = qopenglfResolveAttachShader;
2385     BindAttribLocation = qopenglfResolveBindAttribLocation;
2386     BindBuffer = qopenglfResolveBindBuffer;
2387     BindFramebuffer = qopenglfResolveBindFramebuffer;
2388     BindRenderbuffer = qopenglfResolveBindRenderbuffer;
2389     BlendColor = qopenglfResolveBlendColor;
2390     BlendEquation = qopenglfResolveBlendEquation;
2391     BlendEquationSeparate = qopenglfResolveBlendEquationSeparate;
2392     BlendFuncSeparate = qopenglfResolveBlendFuncSeparate;
2393     BufferData = qopenglfResolveBufferData;
2394     BufferSubData = qopenglfResolveBufferSubData;
2395     CheckFramebufferStatus = qopenglfResolveCheckFramebufferStatus;
2396     CompileShader = qopenglfResolveCompileShader;
2397     CompressedTexImage2D = qopenglfResolveCompressedTexImage2D;
2398     CompressedTexSubImage2D = qopenglfResolveCompressedTexSubImage2D;
2399     CreateProgram = qopenglfResolveCreateProgram;
2400     CreateShader = qopenglfResolveCreateShader;
2401     DeleteBuffers = qopenglfResolveDeleteBuffers;
2402     DeleteFramebuffers = qopenglfResolveDeleteFramebuffers;
2403     DeleteProgram = qopenglfResolveDeleteProgram;
2404     DeleteRenderbuffers = qopenglfResolveDeleteRenderbuffers;
2405     DeleteShader = qopenglfResolveDeleteShader;
2406     DetachShader = qopenglfResolveDetachShader;
2407     DisableVertexAttribArray = qopenglfResolveDisableVertexAttribArray;
2408     EnableVertexAttribArray = qopenglfResolveEnableVertexAttribArray;
2409     FramebufferRenderbuffer = qopenglfResolveFramebufferRenderbuffer;
2410     FramebufferTexture2D = qopenglfResolveFramebufferTexture2D;
2411     GenBuffers = qopenglfResolveGenBuffers;
2412     GenerateMipmap = qopenglfResolveGenerateMipmap;
2413     GenFramebuffers = qopenglfResolveGenFramebuffers;
2414     GenRenderbuffers = qopenglfResolveGenRenderbuffers;
2415     GetActiveAttrib = qopenglfResolveGetActiveAttrib;
2416     GetActiveUniform = qopenglfResolveGetActiveUniform;
2417     GetAttachedShaders = qopenglfResolveGetAttachedShaders;
2418     GetAttribLocation = qopenglfResolveGetAttribLocation;
2419     GetBufferParameteriv = qopenglfResolveGetBufferParameteriv;
2420     GetFramebufferAttachmentParameteriv = qopenglfResolveGetFramebufferAttachmentParameteriv;
2421     GetProgramiv = qopenglfResolveGetProgramiv;
2422     GetProgramInfoLog = qopenglfResolveGetProgramInfoLog;
2423     GetRenderbufferParameteriv = qopenglfResolveGetRenderbufferParameteriv;
2424     GetShaderiv = qopenglfResolveGetShaderiv;
2425     GetShaderInfoLog = qopenglfResolveGetShaderInfoLog;
2426     GetShaderPrecisionFormat = qopenglfResolveGetShaderPrecisionFormat;
2427     GetShaderSource = qopenglfResolveGetShaderSource;
2428     GetUniformfv = qopenglfResolveGetUniformfv;
2429     GetUniformiv = qopenglfResolveGetUniformiv;
2430     GetUniformLocation = qopenglfResolveGetUniformLocation;
2431     GetVertexAttribfv = qopenglfResolveGetVertexAttribfv;
2432     GetVertexAttribiv = qopenglfResolveGetVertexAttribiv;
2433     GetVertexAttribPointerv = qopenglfResolveGetVertexAttribPointerv;
2434     IsBuffer = qopenglfResolveIsBuffer;
2435     IsFramebuffer = qopenglfResolveIsFramebuffer;
2436     IsProgram = qopenglfResolveIsProgram;
2437     IsRenderbuffer = qopenglfResolveIsRenderbuffer;
2438     IsShader = qopenglfResolveIsShader;
2439     LinkProgram = qopenglfResolveLinkProgram;
2440     ReleaseShaderCompiler = qopenglfResolveReleaseShaderCompiler;
2441     RenderbufferStorage = qopenglfResolveRenderbufferStorage;
2442     SampleCoverage = qopenglfResolveSampleCoverage;
2443     ShaderBinary = qopenglfResolveShaderBinary;
2444     ShaderSource = qopenglfResolveShaderSource;
2445     StencilFuncSeparate = qopenglfResolveStencilFuncSeparate;
2446     StencilMaskSeparate = qopenglfResolveStencilMaskSeparate;
2447     StencilOpSeparate = qopenglfResolveStencilOpSeparate;
2448     Uniform1f = qopenglfResolveUniform1f;
2449     Uniform1fv = qopenglfResolveUniform1fv;
2450     Uniform1i = qopenglfResolveUniform1i;
2451     Uniform1iv = qopenglfResolveUniform1iv;
2452     Uniform2f = qopenglfResolveUniform2f;
2453     Uniform2fv = qopenglfResolveUniform2fv;
2454     Uniform2i = qopenglfResolveUniform2i;
2455     Uniform2iv = qopenglfResolveUniform2iv;
2456     Uniform3f = qopenglfResolveUniform3f;
2457     Uniform3fv = qopenglfResolveUniform3fv;
2458     Uniform3i = qopenglfResolveUniform3i;
2459     Uniform3iv = qopenglfResolveUniform3iv;
2460     Uniform4f = qopenglfResolveUniform4f;
2461     Uniform4fv = qopenglfResolveUniform4fv;
2462     Uniform4i = qopenglfResolveUniform4i;
2463     Uniform4iv = qopenglfResolveUniform4iv;
2464     UniformMatrix2fv = qopenglfResolveUniformMatrix2fv;
2465     UniformMatrix3fv = qopenglfResolveUniformMatrix3fv;
2466     UniformMatrix4fv = qopenglfResolveUniformMatrix4fv;
2467     UseProgram = qopenglfResolveUseProgram;
2468     ValidateProgram = qopenglfResolveValidateProgram;
2469     VertexAttrib1f = qopenglfResolveVertexAttrib1f;
2470     VertexAttrib1fv = qopenglfResolveVertexAttrib1fv;
2471     VertexAttrib2f = qopenglfResolveVertexAttrib2f;
2472     VertexAttrib2fv = qopenglfResolveVertexAttrib2fv;
2473     VertexAttrib3f = qopenglfResolveVertexAttrib3f;
2474     VertexAttrib3fv = qopenglfResolveVertexAttrib3fv;
2475     VertexAttrib4f = qopenglfResolveVertexAttrib4f;
2476     VertexAttrib4fv = qopenglfResolveVertexAttrib4fv;
2477     VertexAttribPointer = qopenglfResolveVertexAttribPointer;
2478 #endif // !QT_OPENGL_ES_2
2479 }
2480
2481 QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx)
2482     : QOpenGLFunctionsPrivate(ctx)
2483 {
2484     MapBuffer = qopenglfResolveMapBuffer;
2485     UnmapBuffer = qopenglfResolveUnmapBuffer;
2486     BlitFramebuffer = qopenglfResolveBlitFramebuffer;
2487     RenderbufferStorageMultisample = qopenglfResolveRenderbufferStorageMultisample;
2488     GetBufferSubData = qopenglfResolveGetBufferSubData;
2489 }
2490
2491 QT_END_NAMESPACE