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