Fix QNetworkReply ioGetFromHttpWithCache test case
[profile/ivi/qtbase.git] / src / opengl / qglfunctions.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 QtOpenGL 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 "qglfunctions.h"
43 #include "qgl_p.h"
44 #include "QtGui/private/qopenglcontext_p.h"
45
46 QT_BEGIN_NAMESPACE
47
48 /*!
49     \class QGLFunctions
50     \brief The QGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
51     \since 4.8
52     \ingroup painting-3D
53
54     OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
55     common across many desktop and embedded OpenGL implementations.
56     However, it can be difficult to use the functions from that subset
57     because they need to be resolved manually on desktop systems.
58
59     QGLFunctions provides a guaranteed API that is available on all
60     OpenGL systems and takes care of function resolution on systems
61     that need it.  The recommended way to use QGLFunctions is by
62     direct inheritance:
63
64     \code
65     class MyGLWidget : public QGLWidget, protected QGLFunctions
66     {
67         Q_OBJECT
68     public:
69         MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
70
71     protected:
72         void initializeGL();
73         void paintGL();
74     };
75
76     void MyGLWidget::initializeGL()
77     {
78         initializeGLFunctions();
79     }
80     \endcode
81
82     The \c{paintGL()} function can then use any of the OpenGL/ES 2.0
83     functions without explicit resolution, such as glActiveTexture()
84     in the following example:
85
86     \code
87     void MyGLWidget::paintGL()
88     {
89         glActiveTexture(GL_TEXTURE1);
90         glBindTexture(GL_TEXTURE_2D, textureId);
91         ...
92     }
93     \endcode
94
95     QGLFunctions can also be used directly for ad-hoc invocation
96     of OpenGL/ES 2.0 functions on all platforms:
97
98     \code
99     QGLFunctions glFuncs(QGLContext::currentContext());
100     glFuncs.glActiveTexture(GL_TEXTURE1);
101     \endcode
102
103     QGLFunctions provides wrappers for all OpenGL/ES 2.0 functions,
104     except those like \c{glDrawArrays()}, \c{glViewport()}, and
105     \c{glBindTexture()} that don't have portability issues.
106
107     Including the header for QGLFunctions will also define all of
108     the OpenGL/ES 2.0 macro constants that are not already defined by
109     the system's OpenGL headers, such as \c{GL_TEXTURE1} above.
110
111     The hasOpenGLFeature() and openGLFeatures() functions can be used
112     to determine if the OpenGL implementation has a major OpenGL/ES 2.0
113     feature.  For example, the following checks if non power of two
114     textures are available:
115
116     \code
117     QGLFunctions funcs(QGLContext::currentContext());
118     bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures);
119     \endcode
120 */
121
122 /*!
123     \enum QGLFunctions::OpenGLFeature
124     This enum defines OpenGL/ES 2.0 features that may be optional
125     on other platforms.
126
127     \value Multitexture glActiveTexture() function is available.
128     \value Shaders Shader functions are available.
129     \value Buffers Vertex and index buffer functions are available.
130     \value Framebuffers Framebuffer object functions are available.
131     \value BlendColor glBlendColor() is available.
132     \value BlendEquation glBlendEquation() is available.
133     \value BlendEquationSeparate glBlendEquationSeparate() is available.
134     \value BlendFuncSeparate glBlendFuncSeparate() is available.
135     \value BlendSubtract Blend subtract mode is available.
136     \value CompressedTextures Compressed texture functions are available.
137     \value Multisample glSampleCoverage() function is available.
138     \value StencilSeparate Separate stencil functions are available.
139     \value NPOTTextures Non power of two textures are available.
140 */
141
142 // Hidden private fields for additional extension data.
143 struct QGLFunctionsPrivateEx : public QGLFunctionsPrivate, public QOpenGLSharedResource
144 {
145     QGLFunctionsPrivateEx(QOpenGLContext *context)
146         : QGLFunctionsPrivate(QGLContext::fromOpenGLContext(context))
147         , QOpenGLSharedResource(context->shareGroup())
148         , m_features(-1) {}
149
150     void invalidateResource()
151     {
152         m_features = -1;
153     }
154
155     void freeResource(QOpenGLContext *)
156     {
157         // no gl resources to free
158     }
159
160     int m_features;
161 };
162
163 Q_GLOBAL_STATIC(QOpenGLMultiGroupSharedResource, qt_gl_functions_resource)
164
165 static QGLFunctionsPrivateEx *qt_gl_functions(const QGLContext *context = 0)
166 {
167     if (!context)
168         context = QGLContext::currentContext();
169     Q_ASSERT(context);
170     QGLFunctionsPrivateEx *funcs =
171         reinterpret_cast<QGLFunctionsPrivateEx *>
172             (qt_gl_functions_resource()->value<QGLFunctionsPrivateEx>(context->contextHandle()));
173     return funcs;
174 }
175
176 /*!
177     Constructs a default function resolver.  The resolver cannot
178     be used until initializeGLFunctions() is called to specify
179     the context.
180
181     \sa initializeGLFunctions()
182 */
183 QGLFunctions::QGLFunctions()
184     : d_ptr(0)
185 {
186 }
187
188 /*!
189     Constructs a function resolver for \a context.  If \a context
190     is null, then the resolver will be created for the current QGLContext.
191
192     An object constructed in this way can only be used with \a context
193     and other contexts that share with it.  Use initializeGLFunctions()
194     to change the object's context association.
195
196     \sa initializeGLFunctions()
197 */
198 QGLFunctions::QGLFunctions(const QGLContext *context)
199     : d_ptr(qt_gl_functions(context))
200 {
201 }
202
203 /*!
204     \fn QGLFunctions::~QGLFunctions()
205
206     Destroys this function resolver.
207 */
208
209 static int qt_gl_resolve_features()
210 {
211 #if defined(QT_OPENGL_ES_2)
212     int features = QGLFunctions::Multitexture |
213                    QGLFunctions::Shaders |
214                    QGLFunctions::Buffers |
215                    QGLFunctions::Framebuffers |
216                    QGLFunctions::BlendColor |
217                    QGLFunctions::BlendEquation |
218                    QGLFunctions::BlendEquationSeparate |
219                    QGLFunctions::BlendFuncSeparate |
220                    QGLFunctions::BlendSubtract |
221                    QGLFunctions::CompressedTextures |
222                    QGLFunctions::Multisample |
223                    QGLFunctions::StencilSeparate;
224     QGLExtensionMatcher extensions;
225     if (extensions.match("GL_OES_texture_npot"))
226         features |= QGLFunctions::NPOTTextures;
227     if (extensions.match("GL_IMG_texture_npot"))
228         features |= QGLFunctions::NPOTTextures;
229     return features;
230 #elif defined(QT_OPENGL_ES)
231     int features = QGLFunctions::Multitexture |
232                    QGLFunctions::Buffers |
233                    QGLFunctions::CompressedTextures |
234                    QGLFunctions::Multisample;
235     QGLExtensionMatcher extensions;
236     if (extensions.match("GL_OES_framebuffer_object"))
237         features |= QGLFunctions::Framebuffers;
238     if (extensions.match("GL_OES_blend_equation_separate"))
239         features |= QGLFunctions::BlendEquationSeparate;
240     if (extensions.match("GL_OES_blend_func_separate"))
241         features |= QGLFunctions::BlendFuncSeparate;
242     if (extensions.match("GL_OES_blend_subtract"))
243         features |= QGLFunctions::BlendSubtract;
244     if (extensions.match("GL_OES_texture_npot"))
245         features |= QGLFunctions::NPOTTextures;
246     if (extensions.match("GL_IMG_texture_npot"))
247         features |= QGLFunctions::NPOTTextures;
248     return features;
249 #else
250     int features = 0;
251     QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
252     QGLExtensionMatcher extensions;
253
254     // Recognize features by extension name.
255     if (extensions.match("GL_ARB_multitexture"))
256         features |= QGLFunctions::Multitexture;
257     if (extensions.match("GL_ARB_shader_objects"))
258         features |= QGLFunctions::Shaders;
259     if (extensions.match("GL_EXT_framebuffer_object") ||
260             extensions.match("GL_ARB_framebuffer_object"))
261         features |= QGLFunctions::Framebuffers;
262     if (extensions.match("GL_EXT_blend_color"))
263         features |= QGLFunctions::BlendColor;
264     if (extensions.match("GL_EXT_blend_equation_separate"))
265         features |= QGLFunctions::BlendEquationSeparate;
266     if (extensions.match("GL_EXT_blend_func_separate"))
267         features |= QGLFunctions::BlendFuncSeparate;
268     if (extensions.match("GL_EXT_blend_subtract"))
269         features |= QGLFunctions::BlendSubtract;
270     if (extensions.match("GL_ARB_texture_compression"))
271         features |= QGLFunctions::CompressedTextures;
272     if (extensions.match("GL_ARB_multisample"))
273         features |= QGLFunctions::Multisample;
274     if (extensions.match("GL_ARB_texture_non_power_of_two"))
275         features |= QGLFunctions::NPOTTextures;
276
277     // Recognize features by minimum OpenGL version.
278     if (versions & QGLFormat::OpenGL_Version_1_2) {
279         features |= QGLFunctions::BlendColor |
280                     QGLFunctions::BlendEquation;
281     }
282     if (versions & QGLFormat::OpenGL_Version_1_3) {
283         features |= QGLFunctions::Multitexture |
284                     QGLFunctions::CompressedTextures |
285                     QGLFunctions::Multisample;
286     }
287     if (versions & QGLFormat::OpenGL_Version_1_4)
288         features |= QGLFunctions::BlendFuncSeparate;
289     if (versions & QGLFormat::OpenGL_Version_1_5)
290         features |= QGLFunctions::Buffers;
291     if (versions & QGLFormat::OpenGL_Version_2_0) {
292         features |= QGLFunctions::Shaders |
293                     QGLFunctions::StencilSeparate |
294                     QGLFunctions::BlendEquationSeparate |
295                     QGLFunctions::NPOTTextures;
296     }
297     return features;
298 #endif
299 }
300
301 /*!
302     Returns the set of features that are present on this system's
303     OpenGL implementation.
304
305     It is assumed that the QGLContext associated with this function
306     resolver is current.
307
308     \sa hasOpenGLFeature()
309 */
310 QGLFunctions::OpenGLFeatures QGLFunctions::openGLFeatures() const
311 {
312     QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
313     if (!d)
314         return 0;
315     if (d->m_features == -1)
316         d->m_features = qt_gl_resolve_features();
317     return QGLFunctions::OpenGLFeatures(d->m_features);
318 }
319
320 /*!
321     Returns true if \a feature is present on this system's OpenGL
322     implementation; false otherwise.
323
324     It is assumed that the QGLContext associated with this function
325     resolver is current.
326
327     \sa openGLFeatures()
328 */
329 bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const
330 {
331     QGLFunctionsPrivateEx *d = static_cast<QGLFunctionsPrivateEx *>(d_ptr);
332     if (!d)
333         return false;
334     if (d->m_features == -1)
335         d->m_features = qt_gl_resolve_features();
336     return (d->m_features & int(feature)) != 0;
337 }
338
339 /*!
340     Initializes GL function resolution for \a context.  If \a context
341     is null, then the current QGLContext will be used.
342
343     After calling this function, the QGLFunctions object can only be
344     used with \a context and other contexts that share with it.
345     Call initializeGLFunctions() again to change the object's context
346     association.
347 */
348 void QGLFunctions::initializeGLFunctions(const QGLContext *context)
349 {
350     d_ptr = qt_gl_functions(context);
351 }
352
353 /*!
354     \fn void QGLFunctions::glActiveTexture(GLenum texture)
355
356     Convenience function that calls glActiveTexture(\a texture).
357
358     For more information, see the OpenGL/ES 2.0 documentation for
359     \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
360 */
361
362 /*!
363     \fn void QGLFunctions::glAttachShader(GLuint program, GLuint shader)
364
365     Convenience function that calls glAttachShader(\a program, \a shader).
366
367     For more information, see the OpenGL/ES 2.0 documentation for
368     \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
369
370     This convenience function will do nothing on OpenGL/ES 1.x systems.
371 */
372
373 /*!
374     \fn void QGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
375
376     Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
377
378     For more information, see the OpenGL/ES 2.0 documentation for
379     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
380
381     This convenience function will do nothing on OpenGL/ES 1.x systems.
382 */
383
384 /*!
385     \fn void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
386
387     Convenience function that calls glBindBuffer(\a target, \a buffer).
388
389     For more information, see the OpenGL/ES 2.0 documentation for
390     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
391 */
392
393 /*!
394     \fn void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
395
396     Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
397
398     Note that Qt will translate a \a framebuffer argument of 0 to the currently
399     bound QOpenGLContext's defaultFramebufferObject().
400
401     For more information, see the OpenGL/ES 2.0 documentation for
402     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
403 */
404
405 /*!
406     \fn void QGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
407
408     Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
409
410     For more information, see the OpenGL/ES 2.0 documentation for
411     \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
412 */
413
414 /*!
415     \fn void QGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
416
417     Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
418
419     For more information, see the OpenGL/ES 2.0 documentation for
420     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
421 */
422
423 /*!
424     \fn void QGLFunctions::glBlendEquation(GLenum mode)
425
426     Convenience function that calls glBlendEquation(\a mode).
427
428     For more information, see the OpenGL/ES 2.0 documentation for
429     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
430 */
431
432 /*!
433     \fn void QGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
434
435     Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
436
437     For more information, see the OpenGL/ES 2.0 documentation for
438     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
439 */
440
441 /*!
442     \fn void QGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
443
444     Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
445
446     For more information, see the OpenGL/ES 2.0 documentation for
447     \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
448 */
449
450 /*!
451     \fn void QGLFunctions::glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
452
453     Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
454
455     For more information, see the OpenGL/ES 2.0 documentation for
456     \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
457 */
458
459 /*!
460     \fn void QGLFunctions::glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
461
462     Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
463
464     For more information, see the OpenGL/ES 2.0 documentation for
465     \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
466 */
467
468 /*!
469     \fn GLenum QGLFunctions::glCheckFramebufferStatus(GLenum target)
470
471     Convenience function that calls glCheckFramebufferStatus(\a target).
472
473     For more information, see the OpenGL/ES 2.0 documentation for
474     \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
475 */
476
477 /*!
478     \fn void QGLFunctions::glClearDepthf(GLclampf depth)
479
480     Convenience function that calls glClearDepth(\a depth) on
481     desktop OpenGL systems and glClearDepthf(\a depth) on
482     embedded OpenGL/ES systems.
483
484     For more information, see the OpenGL/ES 2.0 documentation for
485     \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
486 */
487
488 /*!
489     \fn void QGLFunctions::glCompileShader(GLuint shader)
490
491     Convenience function that calls glCompileShader(\a shader).
492
493     For more information, see the OpenGL/ES 2.0 documentation for
494     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
495
496     This convenience function will do nothing on OpenGL/ES 1.x systems.
497 */
498
499 /*!
500     \fn void QGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
501
502     Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
503
504     For more information, see the OpenGL/ES 2.0 documentation for
505     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
506 */
507
508 /*!
509     \fn void QGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
510
511     Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
512
513     For more information, see the OpenGL/ES 2.0 documentation for
514     \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
515 */
516
517 /*!
518     \fn GLuint QGLFunctions::glCreateProgram()
519
520     Convenience function that calls glCreateProgram().
521
522     For more information, see the OpenGL/ES 2.0 documentation for
523     \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
524
525     This convenience function will do nothing on OpenGL/ES 1.x systems.
526 */
527
528 /*!
529     \fn GLuint QGLFunctions::glCreateShader(GLenum type)
530
531     Convenience function that calls glCreateShader(\a type).
532
533     For more information, see the OpenGL/ES 2.0 documentation for
534     \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
535
536     This convenience function will do nothing on OpenGL/ES 1.x systems.
537 */
538
539 /*!
540     \fn void QGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
541
542     Convenience function that calls glDeleteBuffers(\a n, \a buffers).
543
544     For more information, see the OpenGL/ES 2.0 documentation for
545     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
546 */
547
548 /*!
549     \fn void QGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
550
551     Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
552
553     For more information, see the OpenGL/ES 2.0 documentation for
554     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
555 */
556
557 /*!
558     \fn void QGLFunctions::glDeleteProgram(GLuint program)
559
560     Convenience function that calls glDeleteProgram(\a program).
561
562     For more information, see the OpenGL/ES 2.0 documentation for
563     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
564
565     This convenience function will do nothing on OpenGL/ES 1.x systems.
566 */
567
568 /*!
569     \fn void QGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
570
571     Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
572
573     For more information, see the OpenGL/ES 2.0 documentation for
574     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
575 */
576
577 /*!
578     \fn void QGLFunctions::glDeleteShader(GLuint shader)
579
580     Convenience function that calls glDeleteShader(\a shader).
581
582     For more information, see the OpenGL/ES 2.0 documentation for
583     \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
584
585     This convenience function will do nothing on OpenGL/ES 1.x systems.
586 */
587
588 /*!
589     \fn void QGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
590
591     Convenience function that calls glDepthRange(\a zNear, \a zFar) on
592     desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
593     embedded OpenGL/ES systems.
594
595     For more information, see the OpenGL/ES 2.0 documentation for
596     \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
597 */
598
599 /*!
600     \fn void QGLFunctions::glDetachShader(GLuint program, GLuint shader)
601
602     Convenience function that calls glDetachShader(\a program, \a shader).
603
604     For more information, see the OpenGL/ES 2.0 documentation for
605     \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
606
607     This convenience function will do nothing on OpenGL/ES 1.x systems.
608 */
609
610 /*!
611     \fn void QGLFunctions::glDisableVertexAttribArray(GLuint index)
612
613     Convenience function that calls glDisableVertexAttribArray(\a index).
614
615     For more information, see the OpenGL/ES 2.0 documentation for
616     \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
617
618     This convenience function will do nothing on OpenGL/ES 1.x systems.
619 */
620
621 /*!
622     \fn void QGLFunctions::glEnableVertexAttribArray(GLuint index)
623
624     Convenience function that calls glEnableVertexAttribArray(\a index).
625
626     For more information, see the OpenGL/ES 2.0 documentation for
627     \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
628
629     This convenience function will do nothing on OpenGL/ES 1.x systems.
630 */
631
632 /*!
633     \fn void QGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
634
635     Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
636
637     For more information, see the OpenGL/ES 2.0 documentation for
638     \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
639 */
640
641 /*!
642     \fn void QGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
643
644     Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
645
646     For more information, see the OpenGL/ES 2.0 documentation for
647     \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
648 */
649
650 /*!
651     \fn void QGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
652
653     Convenience function that calls glGenBuffers(\a n, \a buffers).
654
655     For more information, see the OpenGL/ES 2.0 documentation for
656     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
657 */
658
659 /*!
660     \fn void QGLFunctions::glGenerateMipmap(GLenum target)
661
662     Convenience function that calls glGenerateMipmap(\a target).
663
664     For more information, see the OpenGL/ES 2.0 documentation for
665     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
666 */
667
668 /*!
669     \fn void QGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
670
671     Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
672
673     For more information, see the OpenGL/ES 2.0 documentation for
674     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
675 */
676
677 /*!
678     \fn void QGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
679
680     Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
681
682     For more information, see the OpenGL/ES 2.0 documentation for
683     \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
684 */
685
686 /*!
687     \fn void QGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
688
689     Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
690
691     For more information, see the OpenGL/ES 2.0 documentation for
692     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
693
694     This convenience function will do nothing on OpenGL/ES 1.x systems.
695 */
696
697 /*!
698     \fn void QGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
699
700     Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
701
702     For more information, see the OpenGL/ES 2.0 documentation for
703     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
704
705     This convenience function will do nothing on OpenGL/ES 1.x systems.
706 */
707
708 /*!
709     \fn void QGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
710
711     Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
712
713     For more information, see the OpenGL/ES 2.0 documentation for
714     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
715
716     This convenience function will do nothing on OpenGL/ES 1.x systems.
717 */
718
719 /*!
720     \fn int QGLFunctions::glGetAttribLocation(GLuint program, const char* name)
721
722     Convenience function that calls glGetAttribLocation(\a program, \a name).
723
724     For more information, see the OpenGL/ES 2.0 documentation for
725     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
726
727     This convenience function will do nothing on OpenGL/ES 1.x systems.
728 */
729
730 /*!
731     \fn void QGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
732
733     Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
734
735     For more information, see the OpenGL/ES 2.0 documentation for
736     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
737 */
738
739 /*!
740     \fn void QGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
741
742     Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
743
744     For more information, see the OpenGL/ES 2.0 documentation for
745     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
746 */
747
748 /*!
749     \fn void QGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
750
751     Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
752
753     For more information, see the OpenGL/ES 2.0 documentation for
754     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
755
756     This convenience function will do nothing on OpenGL/ES 1.x systems.
757 */
758
759 /*!
760     \fn void QGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
761
762     Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
763
764     For more information, see the OpenGL/ES 2.0 documentation for
765     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
766
767     This convenience function will do nothing on OpenGL/ES 1.x systems.
768 */
769
770 /*!
771     \fn void QGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
772
773     Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
774
775     For more information, see the OpenGL/ES 2.0 documentation for
776     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
777 */
778
779 /*!
780     \fn void QGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
781
782     Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
783
784     For more information, see the OpenGL/ES 2.0 documentation for
785     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
786
787     This convenience function will do nothing on OpenGL/ES 1.x systems.
788 */
789
790 /*!
791     \fn void QGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
792
793     Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
794
795     For more information, see the OpenGL/ES 2.0 documentation for
796     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
797
798     This convenience function will do nothing on OpenGL/ES 1.x systems.
799 */
800
801 /*!
802     \fn void QGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
803
804     Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
805
806     For more information, see the OpenGL/ES 2.0 documentation for
807     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
808
809     This convenience function will do nothing on OpenGL/ES 1.x systems.
810 */
811
812 /*!
813     \fn void QGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
814
815     Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
816
817     For more information, see the OpenGL/ES 2.0 documentation for
818     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
819
820     This convenience function will do nothing on OpenGL/ES 1.x systems.
821 */
822
823 /*!
824     \fn void QGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
825
826     Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
827
828     For more information, see the OpenGL/ES 2.0 documentation for
829     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
830
831     This convenience function will do nothing on OpenGL/ES 1.x systems.
832 */
833
834 /*!
835     \fn void QGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
836
837     Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
838
839     For more information, see the OpenGL/ES 2.0 documentation for
840     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
841
842     This convenience function will do nothing on OpenGL/ES 1.x systems.
843 */
844
845 /*!
846     \fn int QGLFunctions::glGetUniformLocation(GLuint program, const char* name)
847
848     Convenience function that calls glGetUniformLocation(\a program, \a name).
849
850     For more information, see the OpenGL/ES 2.0 documentation for
851     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
852
853     This convenience function will do nothing on OpenGL/ES 1.x systems.
854 */
855
856 /*!
857     \fn void QGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
858
859     Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
860
861     For more information, see the OpenGL/ES 2.0 documentation for
862     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
863
864     This convenience function will do nothing on OpenGL/ES 1.x systems.
865 */
866
867 /*!
868     \fn void QGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
869
870     Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
871
872     For more information, see the OpenGL/ES 2.0 documentation for
873     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
874
875     This convenience function will do nothing on OpenGL/ES 1.x systems.
876 */
877
878 /*!
879     \fn void QGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
880
881     Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
882
883     For more information, see the OpenGL/ES 2.0 documentation for
884     \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
885
886     This convenience function will do nothing on OpenGL/ES 1.x systems.
887 */
888
889 /*!
890     \fn GLboolean QGLFunctions::glIsBuffer(GLuint buffer)
891
892     Convenience function that calls glIsBuffer(\a buffer).
893
894     For more information, see the OpenGL/ES 2.0 documentation for
895     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
896 */
897
898 /*!
899     \fn GLboolean QGLFunctions::glIsFramebuffer(GLuint framebuffer)
900
901     Convenience function that calls glIsFramebuffer(\a framebuffer).
902
903     For more information, see the OpenGL/ES 2.0 documentation for
904     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
905 */
906
907 /*!
908     \fn GLboolean QGLFunctions::glIsProgram(GLuint program)
909
910     Convenience function that calls glIsProgram(\a program).
911
912     For more information, see the OpenGL/ES 2.0 documentation for
913     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
914
915     This convenience function will do nothing on OpenGL/ES 1.x systems.
916 */
917
918 /*!
919     \fn GLboolean QGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
920
921     Convenience function that calls glIsRenderbuffer(\a renderbuffer).
922
923     For more information, see the OpenGL/ES 2.0 documentation for
924     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
925 */
926
927 /*!
928     \fn GLboolean QGLFunctions::glIsShader(GLuint shader)
929
930     Convenience function that calls glIsShader(\a shader).
931
932     For more information, see the OpenGL/ES 2.0 documentation for
933     \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
934
935     This convenience function will do nothing on OpenGL/ES 1.x systems.
936 */
937
938 /*!
939     \fn void QGLFunctions::glLinkProgram(GLuint program)
940
941     Convenience function that calls glLinkProgram(\a program).
942
943     For more information, see the OpenGL/ES 2.0 documentation for
944     \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
945
946     This convenience function will do nothing on OpenGL/ES 1.x systems.
947 */
948
949 /*!
950     \fn void QGLFunctions::glReleaseShaderCompiler()
951
952     Convenience function that calls glReleaseShaderCompiler().
953
954     For more information, see the OpenGL/ES 2.0 documentation for
955     \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
956
957     This convenience function will do nothing on OpenGL/ES 1.x systems.
958 */
959
960 /*!
961     \fn void QGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
962
963     Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
964
965     For more information, see the OpenGL/ES 2.0 documentation for
966     \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
967 */
968
969 /*!
970     \fn void QGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
971
972     Convenience function that calls glSampleCoverage(\a value, \a invert).
973
974     For more information, see the OpenGL/ES 2.0 documentation for
975     \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
976 */
977
978 /*!
979     \fn void QGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
980
981     Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
982
983     For more information, see the OpenGL/ES 2.0 documentation for
984     \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
985
986     This convenience function will do nothing on OpenGL/ES 1.x systems.
987 */
988
989 /*!
990     \fn void QGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
991
992     Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
993
994     For more information, see the OpenGL/ES 2.0 documentation for
995     \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
996
997     This convenience function will do nothing on OpenGL/ES 1.x systems.
998 */
999
1000 /*!
1001     \fn void QGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1002
1003     Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
1004
1005     For more information, see the OpenGL/ES 2.0 documentation for
1006     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
1007 */
1008
1009 /*!
1010     \fn void QGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1011
1012     Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
1013
1014     For more information, see the OpenGL/ES 2.0 documentation for
1015     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
1016 */
1017
1018 /*!
1019     \fn void QGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1020
1021     Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
1022
1023     For more information, see the OpenGL/ES 2.0 documentation for
1024     \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
1025 */
1026
1027 /*!
1028     \fn void QGLFunctions::glUniform1f(GLint location, GLfloat x)
1029
1030     Convenience function that calls glUniform1f(\a location, \a x).
1031
1032     For more information, see the OpenGL/ES 2.0 documentation for
1033     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
1034
1035     This convenience function will do nothing on OpenGL/ES 1.x systems.
1036 */
1037
1038 /*!
1039     \fn void QGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1040
1041     Convenience function that calls glUniform1fv(\a location, \a count, \a v).
1042
1043     For more information, see the OpenGL/ES 2.0 documentation for
1044     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
1045
1046     This convenience function will do nothing on OpenGL/ES 1.x systems.
1047 */
1048
1049 /*!
1050     \fn void QGLFunctions::glUniform1i(GLint location, GLint x)
1051
1052     Convenience function that calls glUniform1i(\a location, \a x).
1053
1054     For more information, see the OpenGL/ES 2.0 documentation for
1055     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
1056
1057     This convenience function will do nothing on OpenGL/ES 1.x systems.
1058 */
1059
1060 /*!
1061     \fn void QGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1062
1063     Convenience function that calls glUniform1iv(\a location, \a count, \a v).
1064
1065     For more information, see the OpenGL/ES 2.0 documentation for
1066     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
1067
1068     This convenience function will do nothing on OpenGL/ES 1.x systems.
1069 */
1070
1071 /*!
1072     \fn void QGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1073
1074     Convenience function that calls glUniform2f(\a location, \a x, \a y).
1075
1076     For more information, see the OpenGL/ES 2.0 documentation for
1077     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
1078
1079     This convenience function will do nothing on OpenGL/ES 1.x systems.
1080 */
1081
1082 /*!
1083     \fn void QGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1084
1085     Convenience function that calls glUniform2fv(\a location, \a count, \a v).
1086
1087     For more information, see the OpenGL/ES 2.0 documentation for
1088     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
1089
1090     This convenience function will do nothing on OpenGL/ES 1.x systems.
1091 */
1092
1093 /*!
1094     \fn void QGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1095
1096     Convenience function that calls glUniform2i(\a location, \a x, \a y).
1097
1098     For more information, see the OpenGL/ES 2.0 documentation for
1099     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
1100
1101     This convenience function will do nothing on OpenGL/ES 1.x systems.
1102 */
1103
1104 /*!
1105     \fn void QGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1106
1107     Convenience function that calls glUniform2iv(\a location, \a count, \a v).
1108
1109     For more information, see the OpenGL/ES 2.0 documentation for
1110     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
1111
1112     This convenience function will do nothing on OpenGL/ES 1.x systems.
1113 */
1114
1115 /*!
1116     \fn void QGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1117
1118     Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
1119
1120     For more information, see the OpenGL/ES 2.0 documentation for
1121     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
1122
1123     This convenience function will do nothing on OpenGL/ES 1.x systems.
1124 */
1125
1126 /*!
1127     \fn void QGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1128
1129     Convenience function that calls glUniform3fv(\a location, \a count, \a v).
1130
1131     For more information, see the OpenGL/ES 2.0 documentation for
1132     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
1133
1134     This convenience function will do nothing on OpenGL/ES 1.x systems.
1135 */
1136
1137 /*!
1138     \fn void QGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1139
1140     Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
1141
1142     For more information, see the OpenGL/ES 2.0 documentation for
1143     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
1144
1145     This convenience function will do nothing on OpenGL/ES 1.x systems.
1146 */
1147
1148 /*!
1149     \fn void QGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1150
1151     Convenience function that calls glUniform3iv(\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/glUniform3iv.xml}{glUniform3iv()}.
1155
1156     This convenience function will do nothing on OpenGL/ES 1.x systems.
1157 */
1158
1159 /*!
1160     \fn void QGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1161
1162     Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
1163
1164     For more information, see the OpenGL/ES 2.0 documentation for
1165     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
1166
1167     This convenience function will do nothing on OpenGL/ES 1.x systems.
1168 */
1169
1170 /*!
1171     \fn void QGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1172
1173     Convenience function that calls glUniform4fv(\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/glUniform4fv.xml}{glUniform4fv()}.
1177
1178     This convenience function will do nothing on OpenGL/ES 1.x systems.
1179 */
1180
1181 /*!
1182     \fn void QGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1183
1184     Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
1185
1186     For more information, see the OpenGL/ES 2.0 documentation for
1187     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
1188
1189     This convenience function will do nothing on OpenGL/ES 1.x systems.
1190 */
1191
1192 /*!
1193     \fn void QGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
1194
1195     Convenience function that calls glUniform4iv(\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/glUniform4iv.xml}{glUniform4iv()}.
1199
1200     This convenience function will do nothing on OpenGL/ES 1.x systems.
1201 */
1202
1203 /*!
1204     \fn void QGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1205
1206     Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
1207
1208     For more information, see the OpenGL/ES 2.0 documentation for
1209     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
1210
1211     This convenience function will do nothing on OpenGL/ES 1.x systems.
1212 */
1213
1214 /*!
1215     \fn void QGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1216
1217     Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
1218
1219     For more information, see the OpenGL/ES 2.0 documentation for
1220     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
1221
1222     This convenience function will do nothing on OpenGL/ES 1.x systems.
1223 */
1224
1225 /*!
1226     \fn void QGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1227
1228     Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
1229
1230     For more information, see the OpenGL/ES 2.0 documentation for
1231     \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
1232
1233     This convenience function will do nothing on OpenGL/ES 1.x systems.
1234 */
1235
1236 /*!
1237     \fn void QGLFunctions::glUseProgram(GLuint program)
1238
1239     Convenience function that calls glUseProgram(\a program).
1240
1241     For more information, see the OpenGL/ES 2.0 documentation for
1242     \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
1243
1244     This convenience function will do nothing on OpenGL/ES 1.x systems.
1245 */
1246
1247 /*!
1248     \fn void QGLFunctions::glValidateProgram(GLuint program)
1249
1250     Convenience function that calls glValidateProgram(\a program).
1251
1252     For more information, see the OpenGL/ES 2.0 documentation for
1253     \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
1254
1255     This convenience function will do nothing on OpenGL/ES 1.x systems.
1256 */
1257
1258 /*!
1259     \fn void QGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
1260
1261     Convenience function that calls glVertexAttrib1f(\a indx, \a x).
1262
1263     For more information, see the OpenGL/ES 2.0 documentation for
1264     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
1265
1266     This convenience function will do nothing on OpenGL/ES 1.x systems.
1267 */
1268
1269 /*!
1270     \fn void QGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1271
1272     Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
1273
1274     For more information, see the OpenGL/ES 2.0 documentation for
1275     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
1276
1277     This convenience function will do nothing on OpenGL/ES 1.x systems.
1278 */
1279
1280 /*!
1281     \fn void QGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1282
1283     Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
1284
1285     For more information, see the OpenGL/ES 2.0 documentation for
1286     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
1287
1288     This convenience function will do nothing on OpenGL/ES 1.x systems.
1289 */
1290
1291 /*!
1292     \fn void QGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1293
1294     Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
1295
1296     For more information, see the OpenGL/ES 2.0 documentation for
1297     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
1298
1299     This convenience function will do nothing on OpenGL/ES 1.x systems.
1300 */
1301
1302 /*!
1303     \fn void QGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1304
1305     Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
1306
1307     For more information, see the OpenGL/ES 2.0 documentation for
1308     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
1309
1310     This convenience function will do nothing on OpenGL/ES 1.x systems.
1311 */
1312
1313 /*!
1314     \fn void QGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1315
1316     Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
1317
1318     For more information, see the OpenGL/ES 2.0 documentation for
1319     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
1320
1321     This convenience function will do nothing on OpenGL/ES 1.x systems.
1322 */
1323
1324 /*!
1325     \fn void QGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1326
1327     Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
1328
1329     For more information, see the OpenGL/ES 2.0 documentation for
1330     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
1331
1332     This convenience function will do nothing on OpenGL/ES 1.x systems.
1333 */
1334
1335 /*!
1336     \fn void QGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1337
1338     Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
1339
1340     For more information, see the OpenGL/ES 2.0 documentation for
1341     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
1342
1343     This convenience function will do nothing on OpenGL/ES 1.x systems.
1344 */
1345
1346 /*!
1347     \fn void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1348
1349     Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
1350
1351     For more information, see the OpenGL/ES 2.0 documentation for
1352     \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
1353
1354     This convenience function will do nothing on OpenGL/ES 1.x systems.
1355 */
1356
1357 #ifndef QT_OPENGL_ES_2
1358
1359 static void QGLF_APIENTRY qglfResolveActiveTexture(GLenum texture)
1360 {
1361     typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture);
1362
1363     const QGLContext *context = QGLContext::currentContext();
1364     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1365
1366     funcs->activeTexture = (type_glActiveTexture)
1367         context->getProcAddress(QLatin1String("glActiveTexture"));
1368     if (!funcs->activeTexture) {
1369         funcs->activeTexture = (type_glActiveTexture)
1370             context->getProcAddress(QLatin1String("glActiveTextureARB"));
1371     }
1372
1373     if (funcs->activeTexture)
1374         funcs->activeTexture(texture);
1375     else
1376         funcs->activeTexture = qglfResolveActiveTexture;
1377 }
1378
1379 static void QGLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader)
1380 {
1381     typedef void (QGLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
1382
1383     const QGLContext *context = QGLContext::currentContext();
1384     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1385
1386     funcs->attachShader = (type_glAttachShader)
1387         context->getProcAddress(QLatin1String("glAttachShader"));
1388     if (!funcs->attachShader) {
1389         funcs->attachShader = (type_glAttachShader)
1390             context->getProcAddress(QLatin1String("glAttachObjectARB"));
1391     }
1392
1393     if (funcs->attachShader)
1394         funcs->attachShader(program, shader);
1395     else
1396         funcs->attachShader = qglfResolveAttachShader;
1397 }
1398
1399 static void QGLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
1400 {
1401     typedef void (QGLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
1402
1403     const QGLContext *context = QGLContext::currentContext();
1404     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1405
1406     funcs->bindAttribLocation = (type_glBindAttribLocation)
1407         context->getProcAddress(QLatin1String("glBindAttribLocation"));
1408     if (!funcs->bindAttribLocation) {
1409         funcs->bindAttribLocation = (type_glBindAttribLocation)
1410             context->getProcAddress(QLatin1String("glBindAttribLocationARB"));
1411     }
1412
1413     if (funcs->bindAttribLocation)
1414         funcs->bindAttribLocation(program, index, name);
1415     else
1416         funcs->bindAttribLocation = qglfResolveBindAttribLocation;
1417 }
1418
1419 static void QGLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer)
1420 {
1421     typedef void (QGLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
1422
1423     const QGLContext *context = QGLContext::currentContext();
1424     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1425
1426     funcs->bindBuffer = (type_glBindBuffer)
1427         context->getProcAddress(QLatin1String("glBindBuffer"));
1428 #ifdef QT_OPENGL_ES
1429     if (!funcs->bindBuffer) {
1430         funcs->bindBuffer = (type_glBindBuffer)
1431             context->getProcAddress(QLatin1String("glBindBufferOES"));
1432     }
1433 #endif
1434     if (!funcs->bindBuffer) {
1435         funcs->bindBuffer = (type_glBindBuffer)
1436             context->getProcAddress(QLatin1String("glBindBufferEXT"));
1437     }
1438     if (!funcs->bindBuffer) {
1439         funcs->bindBuffer = (type_glBindBuffer)
1440             context->getProcAddress(QLatin1String("glBindBufferARB"));
1441     }
1442
1443     if (funcs->bindBuffer)
1444         funcs->bindBuffer(target, buffer);
1445     else
1446         funcs->bindBuffer = qglfResolveBindBuffer;
1447 }
1448
1449 static void QGLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
1450 {
1451     typedef void (QGLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
1452
1453     const QGLContext *context = QGLContext::currentContext();
1454     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1455
1456     funcs->bindFramebuffer = (type_glBindFramebuffer)
1457         context->getProcAddress(QLatin1String("glBindFramebuffer"));
1458 #ifdef QT_OPENGL_ES
1459     if (!funcs->bindFramebuffer) {
1460         funcs->bindFramebuffer = (type_glBindFramebuffer)
1461             context->getProcAddress(QLatin1String("glBindFramebufferOES"));
1462     }
1463 #endif
1464     if (!funcs->bindFramebuffer) {
1465         funcs->bindFramebuffer = (type_glBindFramebuffer)
1466             context->getProcAddress(QLatin1String("glBindFramebufferEXT"));
1467     }
1468     if (!funcs->bindFramebuffer) {
1469         funcs->bindFramebuffer = (type_glBindFramebuffer)
1470             context->getProcAddress(QLatin1String("glBindFramebufferARB"));
1471     }
1472
1473     if (funcs->bindFramebuffer)
1474         funcs->bindFramebuffer(target, framebuffer);
1475     else
1476         funcs->bindFramebuffer = qglfResolveBindFramebuffer;
1477 }
1478
1479 static void QGLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
1480 {
1481     typedef void (QGLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
1482
1483     const QGLContext *context = QGLContext::currentContext();
1484     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1485
1486     funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1487         context->getProcAddress(QLatin1String("glBindRenderbuffer"));
1488 #ifdef QT_OPENGL_ES
1489     if (!funcs->bindRenderbuffer) {
1490         funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1491             context->getProcAddress(QLatin1String("glBindRenderbufferOES"));
1492     }
1493 #endif
1494     if (!funcs->bindRenderbuffer) {
1495         funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1496             context->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
1497     }
1498     if (!funcs->bindRenderbuffer) {
1499         funcs->bindRenderbuffer = (type_glBindRenderbuffer)
1500             context->getProcAddress(QLatin1String("glBindRenderbufferARB"));
1501     }
1502
1503     if (funcs->bindRenderbuffer)
1504         funcs->bindRenderbuffer(target, renderbuffer);
1505     else
1506         funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
1507 }
1508
1509 static void QGLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1510 {
1511     typedef void (QGLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1512
1513     const QGLContext *context = QGLContext::currentContext();
1514     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1515
1516     funcs->blendColor = (type_glBlendColor)
1517         context->getProcAddress(QLatin1String("glBlendColor"));
1518 #ifdef QT_OPENGL_ES
1519     if (!funcs->blendColor) {
1520         funcs->blendColor = (type_glBlendColor)
1521             context->getProcAddress(QLatin1String("glBlendColorOES"));
1522     }
1523 #endif
1524     if (!funcs->blendColor) {
1525         funcs->blendColor = (type_glBlendColor)
1526             context->getProcAddress(QLatin1String("glBlendColorEXT"));
1527     }
1528     if (!funcs->blendColor) {
1529         funcs->blendColor = (type_glBlendColor)
1530             context->getProcAddress(QLatin1String("glBlendColorARB"));
1531     }
1532
1533     if (funcs->blendColor)
1534         funcs->blendColor(red, green, blue, alpha);
1535     else
1536         funcs->blendColor = qglfResolveBlendColor;
1537 }
1538
1539 static void QGLF_APIENTRY qglfResolveBlendEquation(GLenum mode)
1540 {
1541     typedef void (QGLF_APIENTRYP type_glBlendEquation)(GLenum mode);
1542
1543     const QGLContext *context = QGLContext::currentContext();
1544     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1545
1546     funcs->blendEquation = (type_glBlendEquation)
1547         context->getProcAddress(QLatin1String("glBlendEquation"));
1548 #ifdef QT_OPENGL_ES
1549     if (!funcs->blendEquation) {
1550         funcs->blendEquation = (type_glBlendEquation)
1551             context->getProcAddress(QLatin1String("glBlendEquationOES"));
1552     }
1553 #endif
1554     if (!funcs->blendEquation) {
1555         funcs->blendEquation = (type_glBlendEquation)
1556             context->getProcAddress(QLatin1String("glBlendEquationEXT"));
1557     }
1558     if (!funcs->blendEquation) {
1559         funcs->blendEquation = (type_glBlendEquation)
1560             context->getProcAddress(QLatin1String("glBlendEquationARB"));
1561     }
1562
1563     if (funcs->blendEquation)
1564         funcs->blendEquation(mode);
1565     else
1566         funcs->blendEquation = qglfResolveBlendEquation;
1567 }
1568
1569 static void QGLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1570 {
1571     typedef void (QGLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
1572
1573     const QGLContext *context = QGLContext::currentContext();
1574     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1575
1576     funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1577         context->getProcAddress(QLatin1String("glBlendEquationSeparate"));
1578 #ifdef QT_OPENGL_ES
1579     if (!funcs->blendEquationSeparate) {
1580         funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1581             context->getProcAddress(QLatin1String("glBlendEquationSeparateOES"));
1582     }
1583 #endif
1584     if (!funcs->blendEquationSeparate) {
1585         funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1586             context->getProcAddress(QLatin1String("glBlendEquationSeparateEXT"));
1587     }
1588     if (!funcs->blendEquationSeparate) {
1589         funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
1590             context->getProcAddress(QLatin1String("glBlendEquationSeparateARB"));
1591     }
1592
1593     if (funcs->blendEquationSeparate)
1594         funcs->blendEquationSeparate(modeRGB, modeAlpha);
1595     else
1596         funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
1597 }
1598
1599 static void QGLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1600 {
1601     typedef void (QGLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1602
1603     const QGLContext *context = QGLContext::currentContext();
1604     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1605
1606     funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1607         context->getProcAddress(QLatin1String("glBlendFuncSeparate"));
1608 #ifdef QT_OPENGL_ES
1609     if (!funcs->blendFuncSeparate) {
1610         funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1611             context->getProcAddress(QLatin1String("glBlendFuncSeparateOES"));
1612     }
1613 #endif
1614     if (!funcs->blendFuncSeparate) {
1615         funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1616             context->getProcAddress(QLatin1String("glBlendFuncSeparateEXT"));
1617     }
1618     if (!funcs->blendFuncSeparate) {
1619         funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
1620             context->getProcAddress(QLatin1String("glBlendFuncSeparateARB"));
1621     }
1622
1623     if (funcs->blendFuncSeparate)
1624         funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1625     else
1626         funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
1627 }
1628
1629 static void QGLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
1630 {
1631     typedef void (QGLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
1632
1633     const QGLContext *context = QGLContext::currentContext();
1634     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1635
1636     funcs->bufferData = (type_glBufferData)
1637         context->getProcAddress(QLatin1String("glBufferData"));
1638 #ifdef QT_OPENGL_ES
1639     if (!funcs->bufferData) {
1640         funcs->bufferData = (type_glBufferData)
1641             context->getProcAddress(QLatin1String("glBufferDataOES"));
1642     }
1643 #endif
1644     if (!funcs->bufferData) {
1645         funcs->bufferData = (type_glBufferData)
1646             context->getProcAddress(QLatin1String("glBufferDataEXT"));
1647     }
1648     if (!funcs->bufferData) {
1649         funcs->bufferData = (type_glBufferData)
1650             context->getProcAddress(QLatin1String("glBufferDataARB"));
1651     }
1652
1653     if (funcs->bufferData)
1654         funcs->bufferData(target, size, data, usage);
1655     else
1656         funcs->bufferData = qglfResolveBufferData;
1657 }
1658
1659 static void QGLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
1660 {
1661     typedef void (QGLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
1662
1663     const QGLContext *context = QGLContext::currentContext();
1664     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1665
1666     funcs->bufferSubData = (type_glBufferSubData)
1667         context->getProcAddress(QLatin1String("glBufferSubData"));
1668 #ifdef QT_OPENGL_ES
1669     if (!funcs->bufferSubData) {
1670         funcs->bufferSubData = (type_glBufferSubData)
1671             context->getProcAddress(QLatin1String("glBufferSubDataOES"));
1672     }
1673 #endif
1674     if (!funcs->bufferSubData) {
1675         funcs->bufferSubData = (type_glBufferSubData)
1676             context->getProcAddress(QLatin1String("glBufferSubDataEXT"));
1677     }
1678     if (!funcs->bufferSubData) {
1679         funcs->bufferSubData = (type_glBufferSubData)
1680             context->getProcAddress(QLatin1String("glBufferSubDataARB"));
1681     }
1682
1683     if (funcs->bufferSubData)
1684         funcs->bufferSubData(target, offset, size, data);
1685     else
1686         funcs->bufferSubData = qglfResolveBufferSubData;
1687 }
1688
1689 static GLenum QGLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target)
1690 {
1691     typedef GLenum (QGLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
1692
1693     const QGLContext *context = QGLContext::currentContext();
1694     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1695
1696     funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1697         context->getProcAddress(QLatin1String("glCheckFramebufferStatus"));
1698 #ifdef QT_OPENGL_ES
1699     if (!funcs->checkFramebufferStatus) {
1700         funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1701             context->getProcAddress(QLatin1String("glCheckFramebufferStatusOES"));
1702     }
1703 #endif
1704     if (!funcs->checkFramebufferStatus) {
1705         funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1706             context->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
1707     }
1708     if (!funcs->checkFramebufferStatus) {
1709         funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
1710             context->getProcAddress(QLatin1String("glCheckFramebufferStatusARB"));
1711     }
1712
1713     if (funcs->checkFramebufferStatus)
1714         return funcs->checkFramebufferStatus(target);
1715     funcs->checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
1716     return GLenum(0);
1717 }
1718
1719 static void QGLF_APIENTRY qglfResolveCompileShader(GLuint shader)
1720 {
1721     typedef void (QGLF_APIENTRYP type_glCompileShader)(GLuint shader);
1722
1723     const QGLContext *context = QGLContext::currentContext();
1724     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1725
1726     funcs->compileShader = (type_glCompileShader)
1727         context->getProcAddress(QLatin1String("glCompileShader"));
1728     if (!funcs->compileShader) {
1729         funcs->compileShader = (type_glCompileShader)
1730             context->getProcAddress(QLatin1String("glCompileShader"));
1731     }
1732
1733     if (funcs->compileShader)
1734         funcs->compileShader(shader);
1735     else
1736         funcs->compileShader = qglfResolveCompileShader;
1737 }
1738
1739 static void QGLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1740 {
1741     typedef void (QGLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1742
1743     const QGLContext *context = QGLContext::currentContext();
1744     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1745
1746     funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1747         context->getProcAddress(QLatin1String("glCompressedTexImage2D"));
1748 #ifdef QT_OPENGL_ES
1749     if (!funcs->compressedTexImage2D) {
1750         funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1751             context->getProcAddress(QLatin1String("glCompressedTexImage2DOES"));
1752     }
1753 #endif
1754     if (!funcs->compressedTexImage2D) {
1755         funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1756             context->getProcAddress(QLatin1String("glCompressedTexImage2DEXT"));
1757     }
1758     if (!funcs->compressedTexImage2D) {
1759         funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
1760             context->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
1761     }
1762
1763     if (funcs->compressedTexImage2D)
1764         funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1765     else
1766         funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
1767 }
1768
1769 static void QGLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1770 {
1771     typedef void (QGLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
1772
1773     const QGLContext *context = QGLContext::currentContext();
1774     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1775
1776     funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1777         context->getProcAddress(QLatin1String("glCompressedTexSubImage2D"));
1778 #ifdef QT_OPENGL_ES
1779     if (!funcs->compressedTexSubImage2D) {
1780         funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1781             context->getProcAddress(QLatin1String("glCompressedTexSubImage2DOES"));
1782     }
1783 #endif
1784     if (!funcs->compressedTexSubImage2D) {
1785         funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1786             context->getProcAddress(QLatin1String("glCompressedTexSubImage2DEXT"));
1787     }
1788     if (!funcs->compressedTexSubImage2D) {
1789         funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
1790             context->getProcAddress(QLatin1String("glCompressedTexSubImage2DARB"));
1791     }
1792
1793     if (funcs->compressedTexSubImage2D)
1794         funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1795     else
1796         funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
1797 }
1798
1799 static GLuint QGLF_APIENTRY qglfResolveCreateProgram()
1800 {
1801     typedef GLuint (QGLF_APIENTRYP type_glCreateProgram)();
1802
1803     const QGLContext *context = QGLContext::currentContext();
1804     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1805
1806     funcs->createProgram = (type_glCreateProgram)
1807         context->getProcAddress(QLatin1String("glCreateProgram"));
1808     if (!funcs->createProgram) {
1809         funcs->createProgram = (type_glCreateProgram)
1810             context->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
1811     }
1812
1813     if (funcs->createProgram)
1814         return funcs->createProgram();
1815     funcs->createProgram = qglfResolveCreateProgram;
1816     return GLuint(0);
1817 }
1818
1819 static GLuint QGLF_APIENTRY qglfResolveCreateShader(GLenum type)
1820 {
1821     typedef GLuint (QGLF_APIENTRYP type_glCreateShader)(GLenum type);
1822
1823     const QGLContext *context = QGLContext::currentContext();
1824     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1825
1826     funcs->createShader = (type_glCreateShader)
1827         context->getProcAddress(QLatin1String("glCreateShader"));
1828     if (!funcs->createShader) {
1829         funcs->createShader = (type_glCreateShader)
1830             context->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
1831     }
1832
1833     if (funcs->createShader)
1834         return funcs->createShader(type);
1835     funcs->createShader = qglfResolveCreateShader;
1836     return GLuint(0);
1837 }
1838
1839 static void QGLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
1840 {
1841     typedef void (QGLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
1842
1843     const QGLContext *context = QGLContext::currentContext();
1844     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1845
1846     funcs->deleteBuffers = (type_glDeleteBuffers)
1847         context->getProcAddress(QLatin1String("glDeleteBuffers"));
1848 #ifdef QT_OPENGL_ES
1849     if (!funcs->deleteBuffers) {
1850         funcs->deleteBuffers = (type_glDeleteBuffers)
1851             context->getProcAddress(QLatin1String("glDeleteBuffersOES"));
1852     }
1853 #endif
1854     if (!funcs->deleteBuffers) {
1855         funcs->deleteBuffers = (type_glDeleteBuffers)
1856             context->getProcAddress(QLatin1String("glDeleteBuffersEXT"));
1857     }
1858     if (!funcs->deleteBuffers) {
1859         funcs->deleteBuffers = (type_glDeleteBuffers)
1860             context->getProcAddress(QLatin1String("glDeleteBuffersARB"));
1861     }
1862
1863     if (funcs->deleteBuffers)
1864         funcs->deleteBuffers(n, buffers);
1865     else
1866         funcs->deleteBuffers = qglfResolveDeleteBuffers;
1867 }
1868
1869 static void QGLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1870 {
1871     typedef void (QGLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
1872
1873     const QGLContext *context = QGLContext::currentContext();
1874     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1875
1876     funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1877         context->getProcAddress(QLatin1String("glDeleteFramebuffers"));
1878 #ifdef QT_OPENGL_ES
1879     if (!funcs->deleteFramebuffers) {
1880         funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1881             context->getProcAddress(QLatin1String("glDeleteFramebuffersOES"));
1882     }
1883 #endif
1884     if (!funcs->deleteFramebuffers) {
1885         funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1886             context->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
1887     }
1888     if (!funcs->deleteFramebuffers) {
1889         funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
1890             context->getProcAddress(QLatin1String("glDeleteFramebuffersARB"));
1891     }
1892
1893     if (funcs->deleteFramebuffers)
1894         funcs->deleteFramebuffers(n, framebuffers);
1895     else
1896         funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
1897 }
1898
1899 static void QGLF_APIENTRY qglfResolveDeleteProgram(GLuint program)
1900 {
1901     typedef void (QGLF_APIENTRYP type_glDeleteProgram)(GLuint program);
1902
1903     const QGLContext *context = QGLContext::currentContext();
1904     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1905
1906     funcs->deleteProgram = (type_glDeleteProgram)
1907         context->getProcAddress(QLatin1String("glDeleteProgram"));
1908     if (!funcs->deleteProgram) {
1909         funcs->deleteProgram = (type_glDeleteProgram)
1910             context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1911     }
1912
1913     if (funcs->deleteProgram)
1914         funcs->deleteProgram(program);
1915     else
1916         funcs->deleteProgram = qglfResolveDeleteProgram;
1917 }
1918
1919 static void QGLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1920 {
1921     typedef void (QGLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
1922
1923     const QGLContext *context = QGLContext::currentContext();
1924     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1925
1926     funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1927         context->getProcAddress(QLatin1String("glDeleteRenderbuffers"));
1928 #ifdef QT_OPENGL_ES
1929     if (!funcs->deleteRenderbuffers) {
1930         funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1931             context->getProcAddress(QLatin1String("glDeleteRenderbuffersOES"));
1932     }
1933 #endif
1934     if (!funcs->deleteRenderbuffers) {
1935         funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1936             context->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
1937     }
1938     if (!funcs->deleteRenderbuffers) {
1939         funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
1940             context->getProcAddress(QLatin1String("glDeleteRenderbuffersARB"));
1941     }
1942
1943     if (funcs->deleteRenderbuffers)
1944         funcs->deleteRenderbuffers(n, renderbuffers);
1945     else
1946         funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
1947 }
1948
1949 static void QGLF_APIENTRY qglfResolveDeleteShader(GLuint shader)
1950 {
1951     typedef void (QGLF_APIENTRYP type_glDeleteShader)(GLuint shader);
1952
1953     const QGLContext *context = QGLContext::currentContext();
1954     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1955
1956     funcs->deleteShader = (type_glDeleteShader)
1957         context->getProcAddress(QLatin1String("glDeleteShader"));
1958     if (!funcs->deleteShader) {
1959         funcs->deleteShader = (type_glDeleteShader)
1960             context->getProcAddress(QLatin1String("glDeleteObjectARB"));
1961     }
1962
1963     if (funcs->deleteShader)
1964         funcs->deleteShader(shader);
1965     else
1966         funcs->deleteShader = qglfResolveDeleteShader;
1967 }
1968
1969 static void QGLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader)
1970 {
1971     typedef void (QGLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
1972
1973     const QGLContext *context = QGLContext::currentContext();
1974     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1975
1976     funcs->detachShader = (type_glDetachShader)
1977         context->getProcAddress(QLatin1String("glDetachShader"));
1978     if (!funcs->detachShader) {
1979         funcs->detachShader = (type_glDetachShader)
1980             context->getProcAddress(QLatin1String("glDetachObjectARB"));
1981     }
1982
1983     if (funcs->detachShader)
1984         funcs->detachShader(program, shader);
1985     else
1986         funcs->detachShader = qglfResolveDetachShader;
1987 }
1988
1989 static void QGLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index)
1990 {
1991     typedef void (QGLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
1992
1993     const QGLContext *context = QGLContext::currentContext();
1994     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
1995
1996     funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
1997         context->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
1998     if (!funcs->disableVertexAttribArray) {
1999         funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
2000             context->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
2001     }
2002
2003     if (funcs->disableVertexAttribArray)
2004         funcs->disableVertexAttribArray(index);
2005     else
2006         funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
2007 }
2008
2009 static void QGLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index)
2010 {
2011     typedef void (QGLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
2012
2013     const QGLContext *context = QGLContext::currentContext();
2014     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2015
2016     funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2017         context->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
2018     if (!funcs->enableVertexAttribArray) {
2019         funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
2020             context->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
2021     }
2022
2023     if (funcs->enableVertexAttribArray)
2024         funcs->enableVertexAttribArray(index);
2025     else
2026         funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
2027 }
2028
2029 static void QGLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
2030 {
2031     typedef void (QGLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
2032
2033     const QGLContext *context = QGLContext::currentContext();
2034     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2035
2036     funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2037         context->getProcAddress(QLatin1String("glFramebufferRenderbuffer"));
2038 #ifdef QT_OPENGL_ES
2039     if (!funcs->framebufferRenderbuffer) {
2040         funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2041             context->getProcAddress(QLatin1String("glFramebufferRenderbufferOES"));
2042     }
2043 #endif
2044     if (!funcs->framebufferRenderbuffer) {
2045         funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2046             context->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
2047     }
2048     if (!funcs->framebufferRenderbuffer) {
2049         funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
2050             context->getProcAddress(QLatin1String("glFramebufferRenderbufferARB"));
2051     }
2052
2053     if (funcs->framebufferRenderbuffer)
2054         funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
2055     else
2056         funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
2057 }
2058
2059 static void QGLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
2060 {
2061     typedef void (QGLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
2062
2063     const QGLContext *context = QGLContext::currentContext();
2064     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2065
2066     funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2067         context->getProcAddress(QLatin1String("glFramebufferTexture2D"));
2068 #ifdef QT_OPENGL_ES
2069     if (!funcs->framebufferTexture2D) {
2070         funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2071             context->getProcAddress(QLatin1String("glFramebufferTexture2DOES"));
2072     }
2073 #endif
2074     if (!funcs->framebufferTexture2D) {
2075         funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2076             context->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
2077     }
2078     if (!funcs->framebufferTexture2D) {
2079         funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
2080             context->getProcAddress(QLatin1String("glFramebufferTexture2DARB"));
2081     }
2082
2083     if (funcs->framebufferTexture2D)
2084         funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
2085     else
2086         funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
2087 }
2088
2089 static void QGLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
2090 {
2091     typedef void (QGLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
2092
2093     const QGLContext *context = QGLContext::currentContext();
2094     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2095
2096     funcs->genBuffers = (type_glGenBuffers)
2097         context->getProcAddress(QLatin1String("glGenBuffers"));
2098 #ifdef QT_OPENGL_ES
2099     if (!funcs->genBuffers) {
2100         funcs->genBuffers = (type_glGenBuffers)
2101             context->getProcAddress(QLatin1String("glGenBuffersOES"));
2102     }
2103 #endif
2104     if (!funcs->genBuffers) {
2105         funcs->genBuffers = (type_glGenBuffers)
2106             context->getProcAddress(QLatin1String("glGenBuffersEXT"));
2107     }
2108     if (!funcs->genBuffers) {
2109         funcs->genBuffers = (type_glGenBuffers)
2110             context->getProcAddress(QLatin1String("glGenBuffersARB"));
2111     }
2112
2113     if (funcs->genBuffers)
2114         funcs->genBuffers(n, buffers);
2115     else
2116         funcs->genBuffers = qglfResolveGenBuffers;
2117 }
2118
2119 static void QGLF_APIENTRY qglfResolveGenerateMipmap(GLenum target)
2120 {
2121     typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
2122
2123     const QGLContext *context = QGLContext::currentContext();
2124     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2125
2126     funcs->generateMipmap = (type_glGenerateMipmap)
2127         context->getProcAddress(QLatin1String("glGenerateMipmap"));
2128 #ifdef QT_OPENGL_ES
2129     if (!funcs->generateMipmap) {
2130         funcs->generateMipmap = (type_glGenerateMipmap)
2131             context->getProcAddress(QLatin1String("glGenerateMipmapOES"));
2132     }
2133 #endif
2134     if (!funcs->generateMipmap) {
2135         funcs->generateMipmap = (type_glGenerateMipmap)
2136             context->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
2137     }
2138     if (!funcs->generateMipmap) {
2139         funcs->generateMipmap = (type_glGenerateMipmap)
2140             context->getProcAddress(QLatin1String("glGenerateMipmapARB"));
2141     }
2142
2143     if (funcs->generateMipmap)
2144         funcs->generateMipmap(target);
2145     else
2146         funcs->generateMipmap = qglfResolveGenerateMipmap;
2147 }
2148
2149 static void QGLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
2150 {
2151     typedef void (QGLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
2152
2153     const QGLContext *context = QGLContext::currentContext();
2154     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2155
2156     funcs->genFramebuffers = (type_glGenFramebuffers)
2157         context->getProcAddress(QLatin1String("glGenFramebuffers"));
2158 #ifdef QT_OPENGL_ES
2159     if (!funcs->genFramebuffers) {
2160         funcs->genFramebuffers = (type_glGenFramebuffers)
2161             context->getProcAddress(QLatin1String("glGenFramebuffersOES"));
2162     }
2163 #endif
2164     if (!funcs->genFramebuffers) {
2165         funcs->genFramebuffers = (type_glGenFramebuffers)
2166             context->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
2167     }
2168     if (!funcs->genFramebuffers) {
2169         funcs->genFramebuffers = (type_glGenFramebuffers)
2170             context->getProcAddress(QLatin1String("glGenFramebuffersARB"));
2171     }
2172
2173     if (funcs->genFramebuffers)
2174         funcs->genFramebuffers(n, framebuffers);
2175     else
2176         funcs->genFramebuffers = qglfResolveGenFramebuffers;
2177 }
2178
2179 static void QGLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
2180 {
2181     typedef void (QGLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
2182
2183     const QGLContext *context = QGLContext::currentContext();
2184     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2185
2186     funcs->genRenderbuffers = (type_glGenRenderbuffers)
2187         context->getProcAddress(QLatin1String("glGenRenderbuffers"));
2188 #ifdef QT_OPENGL_ES
2189     if (!funcs->genRenderbuffers) {
2190         funcs->genRenderbuffers = (type_glGenRenderbuffers)
2191             context->getProcAddress(QLatin1String("glGenRenderbuffersOES"));
2192     }
2193 #endif
2194     if (!funcs->genRenderbuffers) {
2195         funcs->genRenderbuffers = (type_glGenRenderbuffers)
2196             context->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
2197     }
2198     if (!funcs->genRenderbuffers) {
2199         funcs->genRenderbuffers = (type_glGenRenderbuffers)
2200             context->getProcAddress(QLatin1String("glGenRenderbuffersARB"));
2201     }
2202
2203     if (funcs->genRenderbuffers)
2204         funcs->genRenderbuffers(n, renderbuffers);
2205     else
2206         funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
2207 }
2208
2209 static void QGLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2210 {
2211     typedef void (QGLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2212
2213     const QGLContext *context = QGLContext::currentContext();
2214     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2215
2216     funcs->getActiveAttrib = (type_glGetActiveAttrib)
2217         context->getProcAddress(QLatin1String("glGetActiveAttrib"));
2218     if (!funcs->getActiveAttrib) {
2219         funcs->getActiveAttrib = (type_glGetActiveAttrib)
2220             context->getProcAddress(QLatin1String("glGetActiveAttribARB"));
2221     }
2222
2223     if (funcs->getActiveAttrib)
2224         funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
2225     else
2226         funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
2227 }
2228
2229 static void QGLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
2230 {
2231     typedef void (QGLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
2232
2233     const QGLContext *context = QGLContext::currentContext();
2234     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2235
2236     funcs->getActiveUniform = (type_glGetActiveUniform)
2237         context->getProcAddress(QLatin1String("glGetActiveUniform"));
2238     if (!funcs->getActiveUniform) {
2239         funcs->getActiveUniform = (type_glGetActiveUniform)
2240             context->getProcAddress(QLatin1String("glGetActiveUniformARB"));
2241     }
2242
2243     if (funcs->getActiveUniform)
2244         funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
2245     else
2246         funcs->getActiveUniform = qglfResolveGetActiveUniform;
2247 }
2248
2249 static void QGLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
2250 {
2251     typedef void (QGLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
2252
2253     const QGLContext *context = QGLContext::currentContext();
2254     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2255
2256     funcs->getAttachedShaders = (type_glGetAttachedShaders)
2257         context->getProcAddress(QLatin1String("glGetAttachedShaders"));
2258     if (!funcs->getAttachedShaders) {
2259         funcs->getAttachedShaders = (type_glGetAttachedShaders)
2260             context->getProcAddress(QLatin1String("glGetAttachedObjectsARB"));
2261     }
2262
2263     if (funcs->getAttachedShaders)
2264         funcs->getAttachedShaders(program, maxcount, count, shaders);
2265     else
2266         funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
2267 }
2268
2269 static int QGLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name)
2270 {
2271     typedef int (QGLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
2272
2273     const QGLContext *context = QGLContext::currentContext();
2274     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2275
2276     funcs->getAttribLocation = (type_glGetAttribLocation)
2277         context->getProcAddress(QLatin1String("glGetAttribLocation"));
2278     if (!funcs->getAttribLocation) {
2279         funcs->getAttribLocation = (type_glGetAttribLocation)
2280             context->getProcAddress(QLatin1String("glGetAttribLocationARB"));
2281     }
2282
2283     if (funcs->getAttribLocation)
2284         return funcs->getAttribLocation(program, name);
2285     funcs->getAttribLocation = qglfResolveGetAttribLocation;
2286     return int(0);
2287 }
2288
2289 static void QGLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
2290 {
2291     typedef void (QGLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2292
2293     const QGLContext *context = QGLContext::currentContext();
2294     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2295
2296     funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2297         context->getProcAddress(QLatin1String("glGetBufferParameteriv"));
2298 #ifdef QT_OPENGL_ES
2299     if (!funcs->getBufferParameteriv) {
2300         funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2301             context->getProcAddress(QLatin1String("glGetBufferParameterivOES"));
2302     }
2303 #endif
2304     if (!funcs->getBufferParameteriv) {
2305         funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2306             context->getProcAddress(QLatin1String("glGetBufferParameterivEXT"));
2307     }
2308     if (!funcs->getBufferParameteriv) {
2309         funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
2310             context->getProcAddress(QLatin1String("glGetBufferParameterivARB"));
2311     }
2312
2313     if (funcs->getBufferParameteriv)
2314         funcs->getBufferParameteriv(target, pname, params);
2315     else
2316         funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
2317 }
2318
2319 static void QGLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
2320 {
2321     typedef void (QGLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
2322
2323     const QGLContext *context = QGLContext::currentContext();
2324     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2325
2326     funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2327         context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameteriv"));
2328 #ifdef QT_OPENGL_ES
2329     if (!funcs->getFramebufferAttachmentParameteriv) {
2330         funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2331             context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivOES"));
2332     }
2333 #endif
2334     if (!funcs->getFramebufferAttachmentParameteriv) {
2335         funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2336             context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
2337     }
2338     if (!funcs->getFramebufferAttachmentParameteriv) {
2339         funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
2340             context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivARB"));
2341     }
2342
2343     if (funcs->getFramebufferAttachmentParameteriv)
2344         funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
2345     else
2346         funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
2347 }
2348
2349 static void QGLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
2350 {
2351     typedef void (QGLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
2352
2353     const QGLContext *context = QGLContext::currentContext();
2354     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2355
2356     funcs->getProgramiv = (type_glGetProgramiv)
2357         context->getProcAddress(QLatin1String("glGetProgramiv"));
2358     if (!funcs->getProgramiv) {
2359         funcs->getProgramiv = (type_glGetProgramiv)
2360             context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2361     }
2362
2363     if (funcs->getProgramiv)
2364         funcs->getProgramiv(program, pname, params);
2365     else
2366         funcs->getProgramiv = qglfResolveGetProgramiv;
2367 }
2368
2369 static void QGLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
2370 {
2371     typedef void (QGLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
2372
2373     const QGLContext *context = QGLContext::currentContext();
2374     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2375
2376     funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2377         context->getProcAddress(QLatin1String("glGetProgramInfoLog"));
2378     if (!funcs->getProgramInfoLog) {
2379         funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
2380             context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2381     }
2382
2383     if (funcs->getProgramInfoLog)
2384         funcs->getProgramInfoLog(program, bufsize, length, infolog);
2385     else
2386         funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
2387 }
2388
2389 static void QGLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
2390 {
2391     typedef void (QGLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
2392
2393     const QGLContext *context = QGLContext::currentContext();
2394     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2395
2396     funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2397         context->getProcAddress(QLatin1String("glGetRenderbufferParameteriv"));
2398 #ifdef QT_OPENGL_ES
2399     if (!funcs->getRenderbufferParameteriv) {
2400         funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2401             context->getProcAddress(QLatin1String("glGetRenderbufferParameterivOES"));
2402     }
2403 #endif
2404     if (!funcs->getRenderbufferParameteriv) {
2405         funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2406             context->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
2407     }
2408     if (!funcs->getRenderbufferParameteriv) {
2409         funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
2410             context->getProcAddress(QLatin1String("glGetRenderbufferParameterivARB"));
2411     }
2412
2413     if (funcs->getRenderbufferParameteriv)
2414         funcs->getRenderbufferParameteriv(target, pname, params);
2415     else
2416         funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
2417 }
2418
2419 static void QGLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
2420 {
2421     typedef void (QGLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
2422
2423     const QGLContext *context = QGLContext::currentContext();
2424     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2425
2426     funcs->getShaderiv = (type_glGetShaderiv)
2427         context->getProcAddress(QLatin1String("glGetShaderiv"));
2428     if (!funcs->getShaderiv) {
2429         funcs->getShaderiv = (type_glGetShaderiv)
2430             context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
2431     }
2432
2433     if (funcs->getShaderiv)
2434         funcs->getShaderiv(shader, pname, params);
2435     else
2436         funcs->getShaderiv = qglfResolveGetShaderiv;
2437 }
2438
2439 static void QGLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
2440 {
2441     typedef void (QGLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
2442
2443     const QGLContext *context = QGLContext::currentContext();
2444     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2445
2446     funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2447         context->getProcAddress(QLatin1String("glGetShaderInfoLog"));
2448     if (!funcs->getShaderInfoLog) {
2449         funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
2450             context->getProcAddress(QLatin1String("glGetInfoLogARB"));
2451     }
2452
2453     if (funcs->getShaderInfoLog)
2454         funcs->getShaderInfoLog(shader, bufsize, length, infolog);
2455     else
2456         funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
2457 }
2458
2459 static void QGLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2460 {
2461     Q_UNUSED(shadertype);
2462     Q_UNUSED(precisiontype);
2463     range[0] = range[1] = precision[0] = 0;
2464 }
2465
2466 static void QGLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
2467 {
2468     typedef void (QGLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
2469
2470     const QGLContext *context = QGLContext::currentContext();
2471     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2472
2473     funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2474         context->getProcAddress(QLatin1String("glGetShaderPrecisionFormat"));
2475 #ifdef QT_OPENGL_ES
2476     if (!funcs->getShaderPrecisionFormat) {
2477         funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2478             context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatOES"));
2479     }
2480 #endif
2481     if (!funcs->getShaderPrecisionFormat) {
2482         funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2483             context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatEXT"));
2484     }
2485     if (!funcs->getShaderPrecisionFormat) {
2486         funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
2487             context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatARB"));
2488     }
2489
2490     if (!funcs->getShaderPrecisionFormat)
2491         funcs->getShaderPrecisionFormat = qglfSpecialGetShaderPrecisionFormat;
2492
2493     funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
2494 }
2495
2496 static void QGLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
2497 {
2498     typedef void (QGLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
2499
2500     const QGLContext *context = QGLContext::currentContext();
2501     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2502
2503     funcs->getShaderSource = (type_glGetShaderSource)
2504         context->getProcAddress(QLatin1String("glGetShaderSource"));
2505     if (!funcs->getShaderSource) {
2506         funcs->getShaderSource = (type_glGetShaderSource)
2507             context->getProcAddress(QLatin1String("glGetShaderSourceARB"));
2508     }
2509
2510     if (funcs->getShaderSource)
2511         funcs->getShaderSource(shader, bufsize, length, source);
2512     else
2513         funcs->getShaderSource = qglfResolveGetShaderSource;
2514 }
2515
2516 static void QGLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
2517 {
2518     typedef void (QGLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
2519
2520     const QGLContext *context = QGLContext::currentContext();
2521     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2522
2523     funcs->getUniformfv = (type_glGetUniformfv)
2524         context->getProcAddress(QLatin1String("glGetUniformfv"));
2525     if (!funcs->getUniformfv) {
2526         funcs->getUniformfv = (type_glGetUniformfv)
2527             context->getProcAddress(QLatin1String("glGetUniformfvARB"));
2528     }
2529
2530     if (funcs->getUniformfv)
2531         funcs->getUniformfv(program, location, params);
2532     else
2533         funcs->getUniformfv = qglfResolveGetUniformfv;
2534 }
2535
2536 static void QGLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
2537 {
2538     typedef void (QGLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
2539
2540     const QGLContext *context = QGLContext::currentContext();
2541     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2542
2543     funcs->getUniformiv = (type_glGetUniformiv)
2544         context->getProcAddress(QLatin1String("glGetUniformiv"));
2545     if (!funcs->getUniformiv) {
2546         funcs->getUniformiv = (type_glGetUniformiv)
2547             context->getProcAddress(QLatin1String("glGetUniformivARB"));
2548     }
2549
2550     if (funcs->getUniformiv)
2551         funcs->getUniformiv(program, location, params);
2552     else
2553         funcs->getUniformiv = qglfResolveGetUniformiv;
2554 }
2555
2556 static int QGLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name)
2557 {
2558     typedef int (QGLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
2559
2560     const QGLContext *context = QGLContext::currentContext();
2561     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2562
2563     funcs->getUniformLocation = (type_glGetUniformLocation)
2564         context->getProcAddress(QLatin1String("glGetUniformLocation"));
2565     if (!funcs->getUniformLocation) {
2566         funcs->getUniformLocation = (type_glGetUniformLocation)
2567             context->getProcAddress(QLatin1String("glGetUniformLocationARB"));
2568     }
2569
2570     if (funcs->getUniformLocation)
2571         return funcs->getUniformLocation(program, name);
2572     funcs->getUniformLocation = qglfResolveGetUniformLocation;
2573     return int(0);
2574 }
2575
2576 static void QGLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
2577 {
2578     typedef void (QGLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
2579
2580     const QGLContext *context = QGLContext::currentContext();
2581     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2582
2583     funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2584         context->getProcAddress(QLatin1String("glGetVertexAttribfv"));
2585     if (!funcs->getVertexAttribfv) {
2586         funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
2587             context->getProcAddress(QLatin1String("glGetVertexAttribfvARB"));
2588     }
2589
2590     if (funcs->getVertexAttribfv)
2591         funcs->getVertexAttribfv(index, pname, params);
2592     else
2593         funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
2594 }
2595
2596 static void QGLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
2597 {
2598     typedef void (QGLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
2599
2600     const QGLContext *context = QGLContext::currentContext();
2601     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2602
2603     funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2604         context->getProcAddress(QLatin1String("glGetVertexAttribiv"));
2605     if (!funcs->getVertexAttribiv) {
2606         funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
2607             context->getProcAddress(QLatin1String("glGetVertexAttribivARB"));
2608     }
2609
2610     if (funcs->getVertexAttribiv)
2611         funcs->getVertexAttribiv(index, pname, params);
2612     else
2613         funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
2614 }
2615
2616 static void QGLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
2617 {
2618     typedef void (QGLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
2619
2620     const QGLContext *context = QGLContext::currentContext();
2621     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2622
2623     funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2624         context->getProcAddress(QLatin1String("glGetVertexAttribPointerv"));
2625     if (!funcs->getVertexAttribPointerv) {
2626         funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
2627             context->getProcAddress(QLatin1String("glGetVertexAttribPointervARB"));
2628     }
2629
2630     if (funcs->getVertexAttribPointerv)
2631         funcs->getVertexAttribPointerv(index, pname, pointer);
2632     else
2633         funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
2634 }
2635
2636 static GLboolean QGLF_APIENTRY qglfResolveIsBuffer(GLuint buffer)
2637 {
2638     typedef GLboolean (QGLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
2639
2640     const QGLContext *context = QGLContext::currentContext();
2641     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2642
2643     funcs->isBuffer = (type_glIsBuffer)
2644         context->getProcAddress(QLatin1String("glIsBuffer"));
2645 #ifdef QT_OPENGL_ES
2646     if (!funcs->isBuffer) {
2647         funcs->isBuffer = (type_glIsBuffer)
2648             context->getProcAddress(QLatin1String("glIsBufferOES"));
2649     }
2650 #endif
2651     if (!funcs->isBuffer) {
2652         funcs->isBuffer = (type_glIsBuffer)
2653             context->getProcAddress(QLatin1String("glIsBufferEXT"));
2654     }
2655     if (!funcs->isBuffer) {
2656         funcs->isBuffer = (type_glIsBuffer)
2657             context->getProcAddress(QLatin1String("glIsBufferARB"));
2658     }
2659
2660     if (funcs->isBuffer)
2661         return funcs->isBuffer(buffer);
2662     funcs->isBuffer = qglfResolveIsBuffer;
2663     return GLboolean(0);
2664 }
2665
2666 static GLboolean QGLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer)
2667 {
2668     typedef GLboolean (QGLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
2669
2670     const QGLContext *context = QGLContext::currentContext();
2671     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2672
2673     funcs->isFramebuffer = (type_glIsFramebuffer)
2674         context->getProcAddress(QLatin1String("glIsFramebuffer"));
2675 #ifdef QT_OPENGL_ES
2676     if (!funcs->isFramebuffer) {
2677         funcs->isFramebuffer = (type_glIsFramebuffer)
2678             context->getProcAddress(QLatin1String("glIsFramebufferOES"));
2679     }
2680 #endif
2681     if (!funcs->isFramebuffer) {
2682         funcs->isFramebuffer = (type_glIsFramebuffer)
2683             context->getProcAddress(QLatin1String("glIsFramebufferEXT"));
2684     }
2685     if (!funcs->isFramebuffer) {
2686         funcs->isFramebuffer = (type_glIsFramebuffer)
2687             context->getProcAddress(QLatin1String("glIsFramebufferARB"));
2688     }
2689
2690     if (funcs->isFramebuffer)
2691         return funcs->isFramebuffer(framebuffer);
2692     funcs->isFramebuffer = qglfResolveIsFramebuffer;
2693     return GLboolean(0);
2694 }
2695
2696 static GLboolean QGLF_APIENTRY qglfSpecialIsProgram(GLuint program)
2697 {
2698     return program != 0;
2699 }
2700
2701 static GLboolean QGLF_APIENTRY qglfResolveIsProgram(GLuint program)
2702 {
2703     typedef GLboolean (QGLF_APIENTRYP type_glIsProgram)(GLuint program);
2704
2705     const QGLContext *context = QGLContext::currentContext();
2706     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2707
2708     funcs->isProgram = (type_glIsProgram)
2709         context->getProcAddress(QLatin1String("glIsProgram"));
2710     if (!funcs->isProgram) {
2711         funcs->isProgram = (type_glIsProgram)
2712             context->getProcAddress(QLatin1String("glIsProgramARB"));
2713     }
2714
2715     if (!funcs->isProgram)
2716         funcs->isProgram = qglfSpecialIsProgram;
2717
2718     return funcs->isProgram(program);
2719 }
2720
2721 static GLboolean QGLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer)
2722 {
2723     typedef GLboolean (QGLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
2724
2725     const QGLContext *context = QGLContext::currentContext();
2726     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2727
2728     funcs->isRenderbuffer = (type_glIsRenderbuffer)
2729         context->getProcAddress(QLatin1String("glIsRenderbuffer"));
2730 #ifdef QT_OPENGL_ES
2731     if (!funcs->isRenderbuffer) {
2732         funcs->isRenderbuffer = (type_glIsRenderbuffer)
2733             context->getProcAddress(QLatin1String("glIsRenderbufferOES"));
2734     }
2735 #endif
2736     if (!funcs->isRenderbuffer) {
2737         funcs->isRenderbuffer = (type_glIsRenderbuffer)
2738             context->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
2739     }
2740     if (!funcs->isRenderbuffer) {
2741         funcs->isRenderbuffer = (type_glIsRenderbuffer)
2742             context->getProcAddress(QLatin1String("glIsRenderbufferARB"));
2743     }
2744
2745     if (funcs->isRenderbuffer)
2746         return funcs->isRenderbuffer(renderbuffer);
2747     funcs->isRenderbuffer = qglfResolveIsRenderbuffer;
2748     return GLboolean(0);
2749 }
2750
2751 static GLboolean QGLF_APIENTRY qglfSpecialIsShader(GLuint shader)
2752 {
2753     return shader != 0;
2754 }
2755
2756 static GLboolean QGLF_APIENTRY qglfResolveIsShader(GLuint shader)
2757 {
2758     typedef GLboolean (QGLF_APIENTRYP type_glIsShader)(GLuint shader);
2759
2760     const QGLContext *context = QGLContext::currentContext();
2761     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2762
2763     funcs->isShader = (type_glIsShader)
2764         context->getProcAddress(QLatin1String("glIsShader"));
2765     if (!funcs->isShader) {
2766         funcs->isShader = (type_glIsShader)
2767             context->getProcAddress(QLatin1String("glIsShaderARB"));
2768     }
2769
2770     if (!funcs->isShader)
2771         funcs->isShader = qglfSpecialIsShader;
2772
2773     return funcs->isShader(shader);
2774 }
2775
2776 static void QGLF_APIENTRY qglfResolveLinkProgram(GLuint program)
2777 {
2778     typedef void (QGLF_APIENTRYP type_glLinkProgram)(GLuint program);
2779
2780     const QGLContext *context = QGLContext::currentContext();
2781     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2782
2783     funcs->linkProgram = (type_glLinkProgram)
2784         context->getProcAddress(QLatin1String("glLinkProgram"));
2785     if (!funcs->linkProgram) {
2786         funcs->linkProgram = (type_glLinkProgram)
2787             context->getProcAddress(QLatin1String("glLinkProgramARB"));
2788     }
2789
2790     if (funcs->linkProgram)
2791         funcs->linkProgram(program);
2792     else
2793         funcs->linkProgram = qglfResolveLinkProgram;
2794 }
2795
2796 static void QGLF_APIENTRY qglfSpecialReleaseShaderCompiler()
2797 {
2798 }
2799
2800 static void QGLF_APIENTRY qglfResolveReleaseShaderCompiler()
2801 {
2802     typedef void (QGLF_APIENTRYP type_glReleaseShaderCompiler)();
2803
2804     const QGLContext *context = QGLContext::currentContext();
2805     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2806
2807     funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2808         context->getProcAddress(QLatin1String("glReleaseShaderCompiler"));
2809     if (!funcs->releaseShaderCompiler) {
2810         funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
2811             context->getProcAddress(QLatin1String("glReleaseShaderCompilerARB"));
2812     }
2813
2814     if (!funcs->releaseShaderCompiler)
2815         funcs->releaseShaderCompiler = qglfSpecialReleaseShaderCompiler;
2816
2817     funcs->releaseShaderCompiler();
2818 }
2819
2820 static void QGLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2821 {
2822     typedef void (QGLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
2823
2824     const QGLContext *context = QGLContext::currentContext();
2825     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2826
2827     funcs->renderbufferStorage = (type_glRenderbufferStorage)
2828         context->getProcAddress(QLatin1String("glRenderbufferStorage"));
2829 #ifdef QT_OPENGL_ES
2830     if (!funcs->renderbufferStorage) {
2831         funcs->renderbufferStorage = (type_glRenderbufferStorage)
2832             context->getProcAddress(QLatin1String("glRenderbufferStorageOES"));
2833     }
2834 #endif
2835     if (!funcs->renderbufferStorage) {
2836         funcs->renderbufferStorage = (type_glRenderbufferStorage)
2837             context->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
2838     }
2839     if (!funcs->renderbufferStorage) {
2840         funcs->renderbufferStorage = (type_glRenderbufferStorage)
2841             context->getProcAddress(QLatin1String("glRenderbufferStorageARB"));
2842     }
2843
2844     if (funcs->renderbufferStorage)
2845         funcs->renderbufferStorage(target, internalformat, width, height);
2846     else
2847         funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
2848 }
2849
2850 static void QGLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
2851 {
2852     typedef void (QGLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
2853
2854     const QGLContext *context = QGLContext::currentContext();
2855     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2856
2857     funcs->sampleCoverage = (type_glSampleCoverage)
2858         context->getProcAddress(QLatin1String("glSampleCoverage"));
2859 #ifdef QT_OPENGL_ES
2860     if (!funcs->sampleCoverage) {
2861         funcs->sampleCoverage = (type_glSampleCoverage)
2862             context->getProcAddress(QLatin1String("glSampleCoverageOES"));
2863     }
2864 #endif
2865     if (!funcs->sampleCoverage) {
2866         funcs->sampleCoverage = (type_glSampleCoverage)
2867             context->getProcAddress(QLatin1String("glSampleCoverageEXT"));
2868     }
2869     if (!funcs->sampleCoverage) {
2870         funcs->sampleCoverage = (type_glSampleCoverage)
2871             context->getProcAddress(QLatin1String("glSampleCoverageARB"));
2872     }
2873
2874     if (funcs->sampleCoverage)
2875         funcs->sampleCoverage(value, invert);
2876     else
2877         funcs->sampleCoverage = qglfResolveSampleCoverage;
2878 }
2879
2880 static void QGLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
2881 {
2882     typedef void (QGLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
2883
2884     const QGLContext *context = QGLContext::currentContext();
2885     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2886
2887     funcs->shaderBinary = (type_glShaderBinary)
2888         context->getProcAddress(QLatin1String("glShaderBinary"));
2889     if (!funcs->shaderBinary) {
2890         funcs->shaderBinary = (type_glShaderBinary)
2891             context->getProcAddress(QLatin1String("glShaderBinaryARB"));
2892     }
2893
2894     if (funcs->shaderBinary)
2895         funcs->shaderBinary(n, shaders, binaryformat, binary, length);
2896     else
2897         funcs->shaderBinary = qglfResolveShaderBinary;
2898 }
2899
2900 static void QGLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
2901 {
2902     typedef void (QGLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
2903
2904     const QGLContext *context = QGLContext::currentContext();
2905     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2906
2907     funcs->shaderSource = (type_glShaderSource)
2908         context->getProcAddress(QLatin1String("glShaderSource"));
2909     if (!funcs->shaderSource) {
2910         funcs->shaderSource = (type_glShaderSource)
2911             context->getProcAddress(QLatin1String("glShaderSourceARB"));
2912     }
2913
2914     if (funcs->shaderSource)
2915         funcs->shaderSource(shader, count, string, length);
2916     else
2917         funcs->shaderSource = qglfResolveShaderSource;
2918 }
2919
2920 static void QGLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2921 {
2922     typedef void (QGLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
2923
2924     const QGLContext *context = QGLContext::currentContext();
2925     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2926
2927     funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2928         context->getProcAddress(QLatin1String("glStencilFuncSeparate"));
2929 #ifdef QT_OPENGL_ES
2930     if (!funcs->stencilFuncSeparate) {
2931         funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2932             context->getProcAddress(QLatin1String("glStencilFuncSeparateOES"));
2933     }
2934 #endif
2935     if (!funcs->stencilFuncSeparate) {
2936         funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2937             context->getProcAddress(QLatin1String("glStencilFuncSeparateEXT"));
2938     }
2939     if (!funcs->stencilFuncSeparate) {
2940         funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
2941             context->getProcAddress(QLatin1String("glStencilFuncSeparateARB"));
2942     }
2943
2944     if (funcs->stencilFuncSeparate)
2945         funcs->stencilFuncSeparate(face, func, ref, mask);
2946     else
2947         funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
2948 }
2949
2950 static void QGLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
2951 {
2952     typedef void (QGLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
2953
2954     const QGLContext *context = QGLContext::currentContext();
2955     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2956
2957     funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2958         context->getProcAddress(QLatin1String("glStencilMaskSeparate"));
2959 #ifdef QT_OPENGL_ES
2960     if (!funcs->stencilMaskSeparate) {
2961         funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2962             context->getProcAddress(QLatin1String("glStencilMaskSeparateOES"));
2963     }
2964 #endif
2965     if (!funcs->stencilMaskSeparate) {
2966         funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2967             context->getProcAddress(QLatin1String("glStencilMaskSeparateEXT"));
2968     }
2969     if (!funcs->stencilMaskSeparate) {
2970         funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
2971             context->getProcAddress(QLatin1String("glStencilMaskSeparateARB"));
2972     }
2973
2974     if (funcs->stencilMaskSeparate)
2975         funcs->stencilMaskSeparate(face, mask);
2976     else
2977         funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
2978 }
2979
2980 static void QGLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2981 {
2982     typedef void (QGLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
2983
2984     const QGLContext *context = QGLContext::currentContext();
2985     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
2986
2987     funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2988         context->getProcAddress(QLatin1String("glStencilOpSeparate"));
2989 #ifdef QT_OPENGL_ES
2990     if (!funcs->stencilOpSeparate) {
2991         funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2992             context->getProcAddress(QLatin1String("glStencilOpSeparateOES"));
2993     }
2994 #endif
2995     if (!funcs->stencilOpSeparate) {
2996         funcs->stencilOpSeparate = (type_glStencilOpSeparate)
2997             context->getProcAddress(QLatin1String("glStencilOpSeparateEXT"));
2998     }
2999     if (!funcs->stencilOpSeparate) {
3000         funcs->stencilOpSeparate = (type_glStencilOpSeparate)
3001             context->getProcAddress(QLatin1String("glStencilOpSeparateARB"));
3002     }
3003
3004     if (funcs->stencilOpSeparate)
3005         funcs->stencilOpSeparate(face, fail, zfail, zpass);
3006     else
3007         funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
3008 }
3009
3010 static void QGLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x)
3011 {
3012     typedef void (QGLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
3013
3014     const QGLContext *context = QGLContext::currentContext();
3015     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3016
3017     funcs->uniform1f = (type_glUniform1f)
3018         context->getProcAddress(QLatin1String("glUniform1f"));
3019     if (!funcs->uniform1f) {
3020         funcs->uniform1f = (type_glUniform1f)
3021             context->getProcAddress(QLatin1String("glUniform1fARB"));
3022     }
3023
3024     if (funcs->uniform1f)
3025         funcs->uniform1f(location, x);
3026     else
3027         funcs->uniform1f = qglfResolveUniform1f;
3028 }
3029
3030 static void QGLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
3031 {
3032     typedef void (QGLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
3033
3034     const QGLContext *context = QGLContext::currentContext();
3035     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3036
3037     funcs->uniform1fv = (type_glUniform1fv)
3038         context->getProcAddress(QLatin1String("glUniform1fv"));
3039     if (!funcs->uniform1fv) {
3040         funcs->uniform1fv = (type_glUniform1fv)
3041             context->getProcAddress(QLatin1String("glUniform1fvARB"));
3042     }
3043
3044     if (funcs->uniform1fv)
3045         funcs->uniform1fv(location, count, v);
3046     else
3047         funcs->uniform1fv = qglfResolveUniform1fv;
3048 }
3049
3050 static void QGLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x)
3051 {
3052     typedef void (QGLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
3053
3054     const QGLContext *context = QGLContext::currentContext();
3055     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3056
3057     funcs->uniform1i = (type_glUniform1i)
3058         context->getProcAddress(QLatin1String("glUniform1i"));
3059     if (!funcs->uniform1i) {
3060         funcs->uniform1i = (type_glUniform1i)
3061             context->getProcAddress(QLatin1String("glUniform1iARB"));
3062     }
3063
3064     if (funcs->uniform1i)
3065         funcs->uniform1i(location, x);
3066     else
3067         funcs->uniform1i = qglfResolveUniform1i;
3068 }
3069
3070 static void QGLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
3071 {
3072     typedef void (QGLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
3073
3074     const QGLContext *context = QGLContext::currentContext();
3075     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3076
3077     funcs->uniform1iv = (type_glUniform1iv)
3078         context->getProcAddress(QLatin1String("glUniform1iv"));
3079     if (!funcs->uniform1iv) {
3080         funcs->uniform1iv = (type_glUniform1iv)
3081             context->getProcAddress(QLatin1String("glUniform1ivARB"));
3082     }
3083
3084     if (funcs->uniform1iv)
3085         funcs->uniform1iv(location, count, v);
3086     else
3087         funcs->uniform1iv = qglfResolveUniform1iv;
3088 }
3089
3090 static void QGLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
3091 {
3092     typedef void (QGLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
3093
3094     const QGLContext *context = QGLContext::currentContext();
3095     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3096
3097     funcs->uniform2f = (type_glUniform2f)
3098         context->getProcAddress(QLatin1String("glUniform2f"));
3099     if (!funcs->uniform2f) {
3100         funcs->uniform2f = (type_glUniform2f)
3101             context->getProcAddress(QLatin1String("glUniform2fARB"));
3102     }
3103
3104     if (funcs->uniform2f)
3105         funcs->uniform2f(location, x, y);
3106     else
3107         funcs->uniform2f = qglfResolveUniform2f;
3108 }
3109
3110 static void QGLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
3111 {
3112     typedef void (QGLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
3113
3114     const QGLContext *context = QGLContext::currentContext();
3115     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3116
3117     funcs->uniform2fv = (type_glUniform2fv)
3118         context->getProcAddress(QLatin1String("glUniform2fv"));
3119     if (!funcs->uniform2fv) {
3120         funcs->uniform2fv = (type_glUniform2fv)
3121             context->getProcAddress(QLatin1String("glUniform2fvARB"));
3122     }
3123
3124     if (funcs->uniform2fv)
3125         funcs->uniform2fv(location, count, v);
3126     else
3127         funcs->uniform2fv = qglfResolveUniform2fv;
3128 }
3129
3130 static void QGLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y)
3131 {
3132     typedef void (QGLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
3133
3134     const QGLContext *context = QGLContext::currentContext();
3135     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3136
3137     funcs->uniform2i = (type_glUniform2i)
3138         context->getProcAddress(QLatin1String("glUniform2i"));
3139     if (!funcs->uniform2i) {
3140         funcs->uniform2i = (type_glUniform2i)
3141             context->getProcAddress(QLatin1String("glUniform2iARB"));
3142     }
3143
3144     if (funcs->uniform2i)
3145         funcs->uniform2i(location, x, y);
3146     else
3147         funcs->uniform2i = qglfResolveUniform2i;
3148 }
3149
3150 static void QGLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
3151 {
3152     typedef void (QGLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
3153
3154     const QGLContext *context = QGLContext::currentContext();
3155     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3156
3157     funcs->uniform2iv = (type_glUniform2iv)
3158         context->getProcAddress(QLatin1String("glUniform2iv"));
3159     if (!funcs->uniform2iv) {
3160         funcs->uniform2iv = (type_glUniform2iv)
3161             context->getProcAddress(QLatin1String("glUniform2ivARB"));
3162     }
3163
3164     if (funcs->uniform2iv)
3165         funcs->uniform2iv(location, count, v);
3166     else
3167         funcs->uniform2iv = qglfResolveUniform2iv;
3168 }
3169
3170 static void QGLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
3171 {
3172     typedef void (QGLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
3173
3174     const QGLContext *context = QGLContext::currentContext();
3175     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3176
3177     funcs->uniform3f = (type_glUniform3f)
3178         context->getProcAddress(QLatin1String("glUniform3f"));
3179     if (!funcs->uniform3f) {
3180         funcs->uniform3f = (type_glUniform3f)
3181             context->getProcAddress(QLatin1String("glUniform3fARB"));
3182     }
3183
3184     if (funcs->uniform3f)
3185         funcs->uniform3f(location, x, y, z);
3186     else
3187         funcs->uniform3f = qglfResolveUniform3f;
3188 }
3189
3190 static void QGLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
3191 {
3192     typedef void (QGLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
3193
3194     const QGLContext *context = QGLContext::currentContext();
3195     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3196
3197     funcs->uniform3fv = (type_glUniform3fv)
3198         context->getProcAddress(QLatin1String("glUniform3fv"));
3199     if (!funcs->uniform3fv) {
3200         funcs->uniform3fv = (type_glUniform3fv)
3201             context->getProcAddress(QLatin1String("glUniform3fvARB"));
3202     }
3203
3204     if (funcs->uniform3fv)
3205         funcs->uniform3fv(location, count, v);
3206     else
3207         funcs->uniform3fv = qglfResolveUniform3fv;
3208 }
3209
3210 static void QGLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
3211 {
3212     typedef void (QGLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
3213
3214     const QGLContext *context = QGLContext::currentContext();
3215     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3216
3217     funcs->uniform3i = (type_glUniform3i)
3218         context->getProcAddress(QLatin1String("glUniform3i"));
3219     if (!funcs->uniform3i) {
3220         funcs->uniform3i = (type_glUniform3i)
3221             context->getProcAddress(QLatin1String("glUniform3iARB"));
3222     }
3223
3224     if (funcs->uniform3i)
3225         funcs->uniform3i(location, x, y, z);
3226     else
3227         funcs->uniform3i = qglfResolveUniform3i;
3228 }
3229
3230 static void QGLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
3231 {
3232     typedef void (QGLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
3233
3234     const QGLContext *context = QGLContext::currentContext();
3235     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3236
3237     funcs->uniform3iv = (type_glUniform3iv)
3238         context->getProcAddress(QLatin1String("glUniform3iv"));
3239     if (!funcs->uniform3iv) {
3240         funcs->uniform3iv = (type_glUniform3iv)
3241             context->getProcAddress(QLatin1String("glUniform3ivARB"));
3242     }
3243
3244     if (funcs->uniform3iv)
3245         funcs->uniform3iv(location, count, v);
3246     else
3247         funcs->uniform3iv = qglfResolveUniform3iv;
3248 }
3249
3250 static void QGLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3251 {
3252     typedef void (QGLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3253
3254     const QGLContext *context = QGLContext::currentContext();
3255     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3256
3257     funcs->uniform4f = (type_glUniform4f)
3258         context->getProcAddress(QLatin1String("glUniform4f"));
3259     if (!funcs->uniform4f) {
3260         funcs->uniform4f = (type_glUniform4f)
3261             context->getProcAddress(QLatin1String("glUniform4fARB"));
3262     }
3263
3264     if (funcs->uniform4f)
3265         funcs->uniform4f(location, x, y, z, w);
3266     else
3267         funcs->uniform4f = qglfResolveUniform4f;
3268 }
3269
3270 static void QGLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
3271 {
3272     typedef void (QGLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
3273
3274     const QGLContext *context = QGLContext::currentContext();
3275     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3276
3277     funcs->uniform4fv = (type_glUniform4fv)
3278         context->getProcAddress(QLatin1String("glUniform4fv"));
3279     if (!funcs->uniform4fv) {
3280         funcs->uniform4fv = (type_glUniform4fv)
3281             context->getProcAddress(QLatin1String("glUniform4fvARB"));
3282     }
3283
3284     if (funcs->uniform4fv)
3285         funcs->uniform4fv(location, count, v);
3286     else
3287         funcs->uniform4fv = qglfResolveUniform4fv;
3288 }
3289
3290 static void QGLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
3291 {
3292     typedef void (QGLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
3293
3294     const QGLContext *context = QGLContext::currentContext();
3295     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3296
3297     funcs->uniform4i = (type_glUniform4i)
3298         context->getProcAddress(QLatin1String("glUniform4i"));
3299     if (!funcs->uniform4i) {
3300         funcs->uniform4i = (type_glUniform4i)
3301             context->getProcAddress(QLatin1String("glUniform4iARB"));
3302     }
3303
3304     if (funcs->uniform4i)
3305         funcs->uniform4i(location, x, y, z, w);
3306     else
3307         funcs->uniform4i = qglfResolveUniform4i;
3308 }
3309
3310 static void QGLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
3311 {
3312     typedef void (QGLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
3313
3314     const QGLContext *context = QGLContext::currentContext();
3315     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3316
3317     funcs->uniform4iv = (type_glUniform4iv)
3318         context->getProcAddress(QLatin1String("glUniform4iv"));
3319     if (!funcs->uniform4iv) {
3320         funcs->uniform4iv = (type_glUniform4iv)
3321             context->getProcAddress(QLatin1String("glUniform4ivARB"));
3322     }
3323
3324     if (funcs->uniform4iv)
3325         funcs->uniform4iv(location, count, v);
3326     else
3327         funcs->uniform4iv = qglfResolveUniform4iv;
3328 }
3329
3330 static void QGLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3331 {
3332     typedef void (QGLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3333
3334     const QGLContext *context = QGLContext::currentContext();
3335     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3336
3337     funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3338         context->getProcAddress(QLatin1String("glUniformMatrix2fv"));
3339     if (!funcs->uniformMatrix2fv) {
3340         funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
3341             context->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
3342     }
3343
3344     if (funcs->uniformMatrix2fv)
3345         funcs->uniformMatrix2fv(location, count, transpose, value);
3346     else
3347         funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3348 }
3349
3350 static void QGLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3351 {
3352     typedef void (QGLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3353
3354     const QGLContext *context = QGLContext::currentContext();
3355     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3356
3357     funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3358         context->getProcAddress(QLatin1String("glUniformMatrix3fv"));
3359     if (!funcs->uniformMatrix3fv) {
3360         funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
3361             context->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
3362     }
3363
3364     if (funcs->uniformMatrix3fv)
3365         funcs->uniformMatrix3fv(location, count, transpose, value);
3366     else
3367         funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3368 }
3369
3370 static void QGLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3371 {
3372     typedef void (QGLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
3373
3374     const QGLContext *context = QGLContext::currentContext();
3375     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3376
3377     funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3378         context->getProcAddress(QLatin1String("glUniformMatrix4fv"));
3379     if (!funcs->uniformMatrix4fv) {
3380         funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
3381             context->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
3382     }
3383
3384     if (funcs->uniformMatrix4fv)
3385         funcs->uniformMatrix4fv(location, count, transpose, value);
3386     else
3387         funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3388 }
3389
3390 static void QGLF_APIENTRY qglfResolveUseProgram(GLuint program)
3391 {
3392     typedef void (QGLF_APIENTRYP type_glUseProgram)(GLuint program);
3393
3394     const QGLContext *context = QGLContext::currentContext();
3395     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3396
3397     funcs->useProgram = (type_glUseProgram)
3398         context->getProcAddress(QLatin1String("glUseProgram"));
3399     if (!funcs->useProgram) {
3400         funcs->useProgram = (type_glUseProgram)
3401             context->getProcAddress(QLatin1String("glUseProgramObjectARB"));
3402     }
3403
3404     if (funcs->useProgram)
3405         funcs->useProgram(program);
3406     else
3407         funcs->useProgram = qglfResolveUseProgram;
3408 }
3409
3410 static void QGLF_APIENTRY qglfResolveValidateProgram(GLuint program)
3411 {
3412     typedef void (QGLF_APIENTRYP type_glValidateProgram)(GLuint program);
3413
3414     const QGLContext *context = QGLContext::currentContext();
3415     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3416
3417     funcs->validateProgram = (type_glValidateProgram)
3418         context->getProcAddress(QLatin1String("glValidateProgram"));
3419     if (!funcs->validateProgram) {
3420         funcs->validateProgram = (type_glValidateProgram)
3421             context->getProcAddress(QLatin1String("glValidateProgramARB"));
3422     }
3423
3424     if (funcs->validateProgram)
3425         funcs->validateProgram(program);
3426     else
3427         funcs->validateProgram = qglfResolveValidateProgram;
3428 }
3429
3430 static void QGLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
3431 {
3432     typedef void (QGLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
3433
3434     const QGLContext *context = QGLContext::currentContext();
3435     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3436
3437     funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3438         context->getProcAddress(QLatin1String("glVertexAttrib1f"));
3439     if (!funcs->vertexAttrib1f) {
3440         funcs->vertexAttrib1f = (type_glVertexAttrib1f)
3441             context->getProcAddress(QLatin1String("glVertexAttrib1fARB"));
3442     }
3443
3444     if (funcs->vertexAttrib1f)
3445         funcs->vertexAttrib1f(indx, x);
3446     else
3447         funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
3448 }
3449
3450 static void QGLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
3451 {
3452     typedef void (QGLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
3453
3454     const QGLContext *context = QGLContext::currentContext();
3455     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3456
3457     funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3458         context->getProcAddress(QLatin1String("glVertexAttrib1fv"));
3459     if (!funcs->vertexAttrib1fv) {
3460         funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
3461             context->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
3462     }
3463
3464     if (funcs->vertexAttrib1fv)
3465         funcs->vertexAttrib1fv(indx, values);
3466     else
3467         funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3468 }
3469
3470 static void QGLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
3471 {
3472     typedef void (QGLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
3473
3474     const QGLContext *context = QGLContext::currentContext();
3475     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3476
3477     funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3478         context->getProcAddress(QLatin1String("glVertexAttrib2f"));
3479     if (!funcs->vertexAttrib2f) {
3480         funcs->vertexAttrib2f = (type_glVertexAttrib2f)
3481             context->getProcAddress(QLatin1String("glVertexAttrib2fARB"));
3482     }
3483
3484     if (funcs->vertexAttrib2f)
3485         funcs->vertexAttrib2f(indx, x, y);
3486     else
3487         funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
3488 }
3489
3490 static void QGLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
3491 {
3492     typedef void (QGLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
3493
3494     const QGLContext *context = QGLContext::currentContext();
3495     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3496
3497     funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3498         context->getProcAddress(QLatin1String("glVertexAttrib2fv"));
3499     if (!funcs->vertexAttrib2fv) {
3500         funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
3501             context->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
3502     }
3503
3504     if (funcs->vertexAttrib2fv)
3505         funcs->vertexAttrib2fv(indx, values);
3506     else
3507         funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3508 }
3509
3510 static void QGLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
3511 {
3512     typedef void (QGLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
3513
3514     const QGLContext *context = QGLContext::currentContext();
3515     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3516
3517     funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3518         context->getProcAddress(QLatin1String("glVertexAttrib3f"));
3519     if (!funcs->vertexAttrib3f) {
3520         funcs->vertexAttrib3f = (type_glVertexAttrib3f)
3521             context->getProcAddress(QLatin1String("glVertexAttrib3fARB"));
3522     }
3523
3524     if (funcs->vertexAttrib3f)
3525         funcs->vertexAttrib3f(indx, x, y, z);
3526     else
3527         funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
3528 }
3529
3530 static void QGLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
3531 {
3532     typedef void (QGLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
3533
3534     const QGLContext *context = QGLContext::currentContext();
3535     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3536
3537     funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3538         context->getProcAddress(QLatin1String("glVertexAttrib3fv"));
3539     if (!funcs->vertexAttrib3fv) {
3540         funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
3541             context->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
3542     }
3543
3544     if (funcs->vertexAttrib3fv)
3545         funcs->vertexAttrib3fv(indx, values);
3546     else
3547         funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3548 }
3549
3550 static void QGLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3551 {
3552     typedef void (QGLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
3553
3554     const QGLContext *context = QGLContext::currentContext();
3555     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3556
3557     funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3558         context->getProcAddress(QLatin1String("glVertexAttrib4f"));
3559     if (!funcs->vertexAttrib4f) {
3560         funcs->vertexAttrib4f = (type_glVertexAttrib4f)
3561             context->getProcAddress(QLatin1String("glVertexAttrib4fARB"));
3562     }
3563
3564     if (funcs->vertexAttrib4f)
3565         funcs->vertexAttrib4f(indx, x, y, z, w);
3566     else
3567         funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
3568 }
3569
3570 static void QGLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
3571 {
3572     typedef void (QGLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
3573
3574     const QGLContext *context = QGLContext::currentContext();
3575     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3576
3577     funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3578         context->getProcAddress(QLatin1String("glVertexAttrib4fv"));
3579     if (!funcs->vertexAttrib4fv) {
3580         funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
3581             context->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
3582     }
3583
3584     if (funcs->vertexAttrib4fv)
3585         funcs->vertexAttrib4fv(indx, values);
3586     else
3587         funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3588 }
3589
3590 static void QGLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
3591 {
3592     typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
3593
3594     const QGLContext *context = QGLContext::currentContext();
3595     QGLFunctionsPrivate *funcs = qt_gl_functions(context);
3596
3597     funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3598         context->getProcAddress(QLatin1String("glVertexAttribPointer"));
3599     if (!funcs->vertexAttribPointer) {
3600         funcs->vertexAttribPointer = (type_glVertexAttribPointer)
3601             context->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
3602     }
3603
3604     if (funcs->vertexAttribPointer)
3605         funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
3606     else
3607         funcs->vertexAttribPointer = qglfResolveVertexAttribPointer;
3608 }
3609
3610 #endif // !QT_OPENGL_ES_2
3611
3612 QGLFunctionsPrivate::QGLFunctionsPrivate(const QGLContext *)
3613 {
3614 #ifndef QT_OPENGL_ES_2
3615     activeTexture = qglfResolveActiveTexture;
3616     attachShader = qglfResolveAttachShader;
3617     bindAttribLocation = qglfResolveBindAttribLocation;
3618     bindBuffer = qglfResolveBindBuffer;
3619     bindFramebuffer = qglfResolveBindFramebuffer;
3620     bindRenderbuffer = qglfResolveBindRenderbuffer;
3621     blendColor = qglfResolveBlendColor;
3622     blendEquation = qglfResolveBlendEquation;
3623     blendEquationSeparate = qglfResolveBlendEquationSeparate;
3624     blendFuncSeparate = qglfResolveBlendFuncSeparate;
3625     bufferData = qglfResolveBufferData;
3626     bufferSubData = qglfResolveBufferSubData;
3627     checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
3628     compileShader = qglfResolveCompileShader;
3629     compressedTexImage2D = qglfResolveCompressedTexImage2D;
3630     compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
3631     createProgram = qglfResolveCreateProgram;
3632     createShader = qglfResolveCreateShader;
3633     deleteBuffers = qglfResolveDeleteBuffers;
3634     deleteFramebuffers = qglfResolveDeleteFramebuffers;
3635     deleteProgram = qglfResolveDeleteProgram;
3636     deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
3637     deleteShader = qglfResolveDeleteShader;
3638     detachShader = qglfResolveDetachShader;
3639     disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
3640     enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
3641     framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
3642     framebufferTexture2D = qglfResolveFramebufferTexture2D;
3643     genBuffers = qglfResolveGenBuffers;
3644     generateMipmap = qglfResolveGenerateMipmap;
3645     genFramebuffers = qglfResolveGenFramebuffers;
3646     genRenderbuffers = qglfResolveGenRenderbuffers;
3647     getActiveAttrib = qglfResolveGetActiveAttrib;
3648     getActiveUniform = qglfResolveGetActiveUniform;
3649     getAttachedShaders = qglfResolveGetAttachedShaders;
3650     getAttribLocation = qglfResolveGetAttribLocation;
3651     getBufferParameteriv = qglfResolveGetBufferParameteriv;
3652     getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
3653     getProgramiv = qglfResolveGetProgramiv;
3654     getProgramInfoLog = qglfResolveGetProgramInfoLog;
3655     getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
3656     getShaderiv = qglfResolveGetShaderiv;
3657     getShaderInfoLog = qglfResolveGetShaderInfoLog;
3658     getShaderPrecisionFormat = qglfResolveGetShaderPrecisionFormat;
3659     getShaderSource = qglfResolveGetShaderSource;
3660     getUniformfv = qglfResolveGetUniformfv;
3661     getUniformiv = qglfResolveGetUniformiv;
3662     getUniformLocation = qglfResolveGetUniformLocation;
3663     getVertexAttribfv = qglfResolveGetVertexAttribfv;
3664     getVertexAttribiv = qglfResolveGetVertexAttribiv;
3665     getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
3666     isBuffer = qglfResolveIsBuffer;
3667     isFramebuffer = qglfResolveIsFramebuffer;
3668     isProgram = qglfResolveIsProgram;
3669     isRenderbuffer = qglfResolveIsRenderbuffer;
3670     isShader = qglfResolveIsShader;
3671     linkProgram = qglfResolveLinkProgram;
3672     releaseShaderCompiler = qglfResolveReleaseShaderCompiler;
3673     renderbufferStorage = qglfResolveRenderbufferStorage;
3674     sampleCoverage = qglfResolveSampleCoverage;
3675     shaderBinary = qglfResolveShaderBinary;
3676     shaderSource = qglfResolveShaderSource;
3677     stencilFuncSeparate = qglfResolveStencilFuncSeparate;
3678     stencilMaskSeparate = qglfResolveStencilMaskSeparate;
3679     stencilOpSeparate = qglfResolveStencilOpSeparate;
3680     uniform1f = qglfResolveUniform1f;
3681     uniform1fv = qglfResolveUniform1fv;
3682     uniform1i = qglfResolveUniform1i;
3683     uniform1iv = qglfResolveUniform1iv;
3684     uniform2f = qglfResolveUniform2f;
3685     uniform2fv = qglfResolveUniform2fv;
3686     uniform2i = qglfResolveUniform2i;
3687     uniform2iv = qglfResolveUniform2iv;
3688     uniform3f = qglfResolveUniform3f;
3689     uniform3fv = qglfResolveUniform3fv;
3690     uniform3i = qglfResolveUniform3i;
3691     uniform3iv = qglfResolveUniform3iv;
3692     uniform4f = qglfResolveUniform4f;
3693     uniform4fv = qglfResolveUniform4fv;
3694     uniform4i = qglfResolveUniform4i;
3695     uniform4iv = qglfResolveUniform4iv;
3696     uniformMatrix2fv = qglfResolveUniformMatrix2fv;
3697     uniformMatrix3fv = qglfResolveUniformMatrix3fv;
3698     uniformMatrix4fv = qglfResolveUniformMatrix4fv;
3699     useProgram = qglfResolveUseProgram;
3700     validateProgram = qglfResolveValidateProgram;
3701     vertexAttrib1f = qglfResolveVertexAttrib1f;
3702     vertexAttrib1fv = qglfResolveVertexAttrib1fv;
3703     vertexAttrib2f = qglfResolveVertexAttrib2f;
3704     vertexAttrib2fv = qglfResolveVertexAttrib2fv;
3705     vertexAttrib3f = qglfResolveVertexAttrib3f;
3706     vertexAttrib3fv = qglfResolveVertexAttrib3fv;
3707     vertexAttrib4f = qglfResolveVertexAttrib4f;
3708     vertexAttrib4fv = qglfResolveVertexAttrib4fv;
3709     vertexAttribPointer = qglfResolveVertexAttribPointer;
3710 #endif // !QT_OPENGL_ES_2
3711 }
3712
3713 QT_END_NAMESPACE