1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtGui 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 The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QOPENGLFUNCTIONS_H
41#define QOPENGLFUNCTIONS_H
42
43#include <QtGui/qtguiglobal.h>
44
45#ifndef QT_NO_OPENGL
46
47#ifdef __GLEW_H__
48#if defined(Q_CC_GNU)
49#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
50#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
51#endif
52#endif
53
54#include <QtGui/qopengl.h>
55#include <QtGui/qopenglcontext.h>
56
57//#define Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
58
59#if QT_CONFIG(opengles2)
60typedef double GLdouble;
61#endif
62
63#ifdef Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
64#include <stdio.h>
65#define Q_OPENGL_FUNCTIONS_DEBUG \
66 GLenum error = glGetError(); \
67 if (error != GL_NO_ERROR) { \
68 unsigned clamped = qMin(unsigned(error - GL_INVALID_ENUM), 4U); \
69 const char *errors[] = { "GL_INVALID_ENUM", "GL_INVALID_VALUE", "GL_INVALID_OPERATION", "Unknown" }; \
70 printf("GL error at %s:%d: %s\n", __FILE__, __LINE__, errors[clamped]); \
71 int *value = nullptr; \
72 *value = 0; \
73 }
74#else
75#define Q_OPENGL_FUNCTIONS_DEBUG
76#endif
77
78QT_BEGIN_NAMESPACE
79
80struct QOpenGLFunctionsPrivate;
81
82// Undefine any macros from GLEW, qopenglextensions_p.h, etc that
83// may interfere with the definition of QOpenGLFunctions.
84#undef glBindTexture
85#undef glBlendFunc
86#undef glClear
87#undef glClearColor
88#undef glClearStencil
89#undef glColorMask
90#undef glCopyTexImage2D
91#undef glCopyTexSubImage2D
92#undef glCullFace
93#undef glDeleteTextures
94#undef glDepthFunc
95#undef glDepthMask
96#undef glDisable
97#undef glDrawArrays
98#undef glDrawElements
99#undef glEnable
100#undef glFinish
101#undef glFlush
102#undef glFrontFace
103#undef glGenTextures
104#undef glGetBooleanv
105#undef glGetError
106#undef glGetFloatv
107#undef glGetIntegerv
108#undef glGetString
109#undef glGetTexParameterfv
110#undef glGetTexParameteriv
111#undef glHint
112#undef glIsEnabled
113#undef glIsTexture
114#undef glLineWidth
115#undef glPixelStorei
116#undef glPolygonOffset
117#undef glReadPixels
118#undef glScissor
119#undef glStencilFunc
120#undef glStencilMask
121#undef glStencilOp
122#undef glTexImage2D
123#undef glTexParameterf
124#undef glTexParameterfv
125#undef glTexParameteri
126#undef glTexParameteriv
127#undef glTexSubImage2D
128#undef glViewport
129
130#undef glActiveTexture
131#undef glAttachShader
132#undef glBindAttribLocation
133#undef glBindBuffer
134#undef glBindFramebuffer
135#undef glBindRenderbuffer
136#undef glBlendColor
137#undef glBlendEquation
138#undef glBlendEquationSeparate
139#undef glBlendFuncSeparate
140#undef glBufferData
141#undef glBufferSubData
142#undef glCheckFramebufferStatus
143#undef glClearDepthf
144#undef glCompileShader
145#undef glCompressedTexImage2D
146#undef glCompressedTexSubImage2D
147#undef glCreateProgram
148#undef glCreateShader
149#undef glDeleteBuffers
150#undef glDeleteFramebuffers
151#undef glDeleteProgram
152#undef glDeleteRenderbuffers
153#undef glDeleteShader
154#undef glDepthRangef
155#undef glDetachShader
156#undef glDisableVertexAttribArray
157#undef glEnableVertexAttribArray
158#undef glFramebufferRenderbuffer
159#undef glFramebufferTexture2D
160#undef glGenBuffers
161#undef glGenerateMipmap
162#undef glGenFramebuffers
163#undef glGenRenderbuffers
164#undef glGetActiveAttrib
165#undef glGetActiveUniform
166#undef glGetAttachedShaders
167#undef glGetAttribLocation
168#undef glGetBufferParameteriv
169#undef glGetFramebufferAttachmentParameteriv
170#undef glGetProgramiv
171#undef glGetProgramInfoLog
172#undef glGetRenderbufferParameteriv
173#undef glGetShaderiv
174#undef glGetShaderInfoLog
175#undef glGetShaderPrecisionFormat
176#undef glGetShaderSource
177#undef glGetUniformfv
178#undef glGetUniformiv
179#undef glGetUniformLocation
180#undef glGetVertexAttribfv
181#undef glGetVertexAttribiv
182#undef glGetVertexAttribPointerv
183#undef glIsBuffer
184#undef glIsFramebuffer
185#undef glIsProgram
186#undef glIsRenderbuffer
187#undef glIsShader
188#undef glLinkProgram
189#undef glReleaseShaderCompiler
190#undef glRenderbufferStorage
191#undef glSampleCoverage
192#undef glShaderBinary
193#undef glShaderSource
194#undef glStencilFuncSeparate
195#undef glStencilMaskSeparate
196#undef glStencilOpSeparate
197#undef glUniform1f
198#undef glUniform1fv
199#undef glUniform1i
200#undef glUniform1iv
201#undef glUniform2f
202#undef glUniform2fv
203#undef glUniform2i
204#undef glUniform2iv
205#undef glUniform3f
206#undef glUniform3fv
207#undef glUniform3i
208#undef glUniform3iv
209#undef glUniform4f
210#undef glUniform4fv
211#undef glUniform4i
212#undef glUniform4iv
213#undef glUniformMatrix2fv
214#undef glUniformMatrix3fv
215#undef glUniformMatrix4fv
216#undef glUseProgram
217#undef glValidateProgram
218#undef glVertexAttrib1f
219#undef glVertexAttrib1fv
220#undef glVertexAttrib2f
221#undef glVertexAttrib2fv
222#undef glVertexAttrib3f
223#undef glVertexAttrib3fv
224#undef glVertexAttrib4f
225#undef glVertexAttrib4fv
226#undef glVertexAttribPointer
227
228#undef glTexLevelParameteriv
229
230#if defined(Q_CLANG_QDOC)
231#undef GLbitfield
232typedef unsigned int GLbitfield;
233#undef GLchar
234typedef char GLchar;
235#endif
236
237class Q_GUI_EXPORT QOpenGLFunctions
238{
239public:
240 QOpenGLFunctions();
241 explicit QOpenGLFunctions(QOpenGLContext *context);
242 ~QOpenGLFunctions() {}
243
244 enum OpenGLFeature
245 {
246 Multitexture = 0x0001,
247 Shaders = 0x0002,
248 Buffers = 0x0004,
249 Framebuffers = 0x0008,
250 BlendColor = 0x0010,
251 BlendEquation = 0x0020,
252 BlendEquationSeparate = 0x0040,
253 BlendFuncSeparate = 0x0080,
254 BlendSubtract = 0x0100,
255 CompressedTextures = 0x0200,
256 Multisample = 0x0400,
257 StencilSeparate = 0x0800,
258 NPOTTextures = 0x1000,
259 NPOTTextureRepeat = 0x2000,
260 FixedFunctionPipeline = 0x4000,
261 TextureRGFormats = 0x8000,
262 MultipleRenderTargets = 0x10000,
263 BlendEquationAdvanced = 0x20000,
264 };
265 Q_DECLARE_FLAGS(OpenGLFeatures, OpenGLFeature)
266
267 QOpenGLFunctions::OpenGLFeatures openGLFeatures() const;
268 bool hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const;
269
270 void initializeOpenGLFunctions();
271
272 // GLES2 + OpenGL1 common subset
273 void glBindTexture(GLenum target, GLuint texture);
274 void glBlendFunc(GLenum sfactor, GLenum dfactor);
275 void glClear(GLbitfield mask);
276 void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
277 void glClearStencil(GLint s);
278 void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
279 void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
280 void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
281 void glCullFace(GLenum mode);
282 void glDeleteTextures(GLsizei n, const GLuint* textures);
283 void glDepthFunc(GLenum func);
284 void glDepthMask(GLboolean flag);
285 void glDisable(GLenum cap);
286 void glDrawArrays(GLenum mode, GLint first, GLsizei count);
287 void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
288 void glEnable(GLenum cap);
289 void glFinish();
290 void glFlush();
291 void glFrontFace(GLenum mode);
292 void glGenTextures(GLsizei n, GLuint* textures);
293 void glGetBooleanv(GLenum pname, GLboolean* params);
294 GLenum glGetError();
295 void glGetFloatv(GLenum pname, GLfloat* params);
296 void glGetIntegerv(GLenum pname, GLint* params);
297 const GLubyte *glGetString(GLenum name);
298 void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
299 void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
300 void glHint(GLenum target, GLenum mode);
301 GLboolean glIsEnabled(GLenum cap);
302 GLboolean glIsTexture(GLuint texture);
303 void glLineWidth(GLfloat width);
304 void glPixelStorei(GLenum pname, GLint param);
305 void glPolygonOffset(GLfloat factor, GLfloat units);
306 void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
307 void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
308 void glStencilFunc(GLenum func, GLint ref, GLuint mask);
309 void glStencilMask(GLuint mask);
310 void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
311 void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
312 void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
313 void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
314 void glTexParameteri(GLenum target, GLenum pname, GLint param);
315 void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
316 void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
317 void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
318
319 // GL(ES)2
320 void glActiveTexture(GLenum texture);
321 void glAttachShader(GLuint program, GLuint shader);
322 void glBindAttribLocation(GLuint program, GLuint index, const char* name);
323 void glBindBuffer(GLenum target, GLuint buffer);
324 void glBindFramebuffer(GLenum target, GLuint framebuffer);
325 void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
326 void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
327 void glBlendEquation(GLenum mode);
328 void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
329 void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
330 void glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage);
331 void glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data);
332 GLenum glCheckFramebufferStatus(GLenum target);
333 void glClearDepthf(GLclampf depth);
334 void glCompileShader(GLuint shader);
335 void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
336 void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
337 GLuint glCreateProgram();
338 GLuint glCreateShader(GLenum type);
339 void glDeleteBuffers(GLsizei n, const GLuint* buffers);
340 void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
341 void glDeleteProgram(GLuint program);
342 void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
343 void glDeleteShader(GLuint shader);
344 void glDepthRangef(GLclampf zNear, GLclampf zFar);
345 void glDetachShader(GLuint program, GLuint shader);
346 void glDisableVertexAttribArray(GLuint index);
347 void glEnableVertexAttribArray(GLuint index);
348 void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
349 void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
350 void glGenBuffers(GLsizei n, GLuint* buffers);
351 void glGenerateMipmap(GLenum target);
352 void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
353 void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
354 void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
355 void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
356 void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
357 GLint glGetAttribLocation(GLuint program, const char* name);
358 void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
359 void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
360 void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
361 void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
362 void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
363 void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
364 void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
365 void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
366 void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
367 void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
368 void glGetUniformiv(GLuint program, GLint location, GLint* params);
369 GLint glGetUniformLocation(GLuint program, const char* name);
370 void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
371 void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
372 void glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer);
373 GLboolean glIsBuffer(GLuint buffer);
374 GLboolean glIsFramebuffer(GLuint framebuffer);
375 GLboolean glIsProgram(GLuint program);
376 GLboolean glIsRenderbuffer(GLuint renderbuffer);
377 GLboolean glIsShader(GLuint shader);
378 void glLinkProgram(GLuint program);
379 void glReleaseShaderCompiler();
380 void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
381 void glSampleCoverage(GLclampf value, GLboolean invert);
382 void glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
383 void glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length);
384 void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
385 void glStencilMaskSeparate(GLenum face, GLuint mask);
386 void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
387 void glUniform1f(GLint location, GLfloat x);
388 void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
389 void glUniform1i(GLint location, GLint x);
390 void glUniform1iv(GLint location, GLsizei count, const GLint* v);
391 void glUniform2f(GLint location, GLfloat x, GLfloat y);
392 void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
393 void glUniform2i(GLint location, GLint x, GLint y);
394 void glUniform2iv(GLint location, GLsizei count, const GLint* v);
395 void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
396 void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
397 void glUniform3i(GLint location, GLint x, GLint y, GLint z);
398 void glUniform3iv(GLint location, GLsizei count, const GLint* v);
399 void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
400 void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
401 void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
402 void glUniform4iv(GLint location, GLsizei count, const GLint* v);
403 void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
404 void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
405 void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
406 void glUseProgram(GLuint program);
407 void glValidateProgram(GLuint program);
408 void glVertexAttrib1f(GLuint indx, GLfloat x);
409 void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
410 void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
411 void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
412 void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
413 void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
414 void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
415 void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
416 void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
417
418protected:
419 QOpenGLFunctionsPrivate *d_ptr;
420 static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != nullptr; }
421};
422
423Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures)
424
425#define QT_OPENGL_DECLARE_FUNCTIONS(ret, name, args) \
426 ret (QOPENGLF_APIENTRYP name)args;
427#define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1
428
429#define QT_OPENGL_DECLARE(FUNCTIONS) \
430public: \
431 struct Functions { \
432 FUNCTIONS(QT_OPENGL_DECLARE_FUNCTIONS) \
433 }; \
434 union { \
435 QFunctionPointer functions[FUNCTIONS(QT_OPENGL_COUNT_FUNCTIONS)]; \
436 Functions f; \
437 }; \
438private: \
439 void init(QOpenGLContext *context);
440
441struct QOpenGLFunctionsPrivate
442{
443 QOpenGLFunctionsPrivate(QOpenGLContext *ctx);
444
445#define QT_OPENGL_FUNCTIONS(F) \
446 F(void, BindTexture, (GLenum target, GLuint texture)) \
447 F(void, BlendFunc, (GLenum sfactor, GLenum dfactor)) \
448 F(void, Clear, (GLbitfield mask)) \
449 F(void, ClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) \
450 F(void, ClearDepthf, (GLclampf depth)) \
451 F(void, ClearStencil, (GLint s)) \
452 F(void, ColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) \
453 F(void, CopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) \
454 F(void, CopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) \
455 F(void, CullFace, (GLenum mode)) \
456 F(void, DeleteTextures, (GLsizei n, const GLuint* textures)) \
457 F(void, DepthFunc, (GLenum func)) \
458 F(void, DepthMask, (GLboolean flag)) \
459 F(void, DepthRangef, (GLclampf nearVal, GLclampf farVal)) \
460 F(void, Disable, (GLenum cap)) \
461 F(void, DrawArrays, (GLenum mode, GLint first, GLsizei count)) \
462 F(void, DrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)) \
463 F(void, Enable, (GLenum cap)) \
464 F(void, Finish, ()) \
465 F(void, Flush, ()) \
466 F(void, FrontFace, (GLenum mode)) \
467 F(void, GenTextures, (GLsizei n, GLuint* textures)) \
468 F(void, GetBooleanv, (GLenum pname, GLboolean* params)) \
469 F(GLenum, GetError, ()) \
470 F(void, GetFloatv, (GLenum pname, GLfloat* params)) \
471 F(void, GetIntegerv, (GLenum pname, GLint* params)) \
472 F(const GLubyte *, GetString, (GLenum name)) \
473 F(void, GetTexParameterfv, (GLenum target, GLenum pname, GLfloat* params)) \
474 F(void, GetTexParameteriv, (GLenum target, GLenum pname, GLint* params)) \
475 F(void, Hint, (GLenum target, GLenum mode)) \
476 F(GLboolean, IsEnabled, (GLenum cap)) \
477 F(GLboolean, IsTexture, (GLuint texture)) \
478 F(void, LineWidth, (GLfloat width)) \
479 F(void, PixelStorei, (GLenum pname, GLint param)) \
480 F(void, PolygonOffset, (GLfloat factor, GLfloat units)) \
481 F(void, ReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)) \
482 F(void, Scissor, (GLint x, GLint y, GLsizei width, GLsizei height)) \
483 F(void, StencilFunc, (GLenum func, GLint ref, GLuint mask)) \
484 F(void, StencilMask, (GLuint mask)) \
485 F(void, StencilOp, (GLenum fail, GLenum zfail, GLenum zpass)) \
486 F(void, TexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)) \
487 F(void, TexParameterf, (GLenum target, GLenum pname, GLfloat param)) \
488 F(void, TexParameterfv, (GLenum target, GLenum pname, const GLfloat* params)) \
489 F(void, TexParameteri, (GLenum target, GLenum pname, GLint param)) \
490 F(void, TexParameteriv, (GLenum target, GLenum pname, const GLint* params)) \
491 F(void, TexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)) \
492 F(void, Viewport, (GLint x, GLint y, GLsizei width, GLsizei height)) \
493 F(void, ActiveTexture, (GLenum texture)) \
494 F(void, AttachShader, (GLuint program, GLuint shader)) \
495 F(void, BindAttribLocation, (GLuint program, GLuint index, const char* name)) \
496 F(void, BindBuffer, (GLenum target, GLuint buffer)) \
497 F(void, BindFramebuffer, (GLenum target, GLuint framebuffer)) \
498 F(void, BindRenderbuffer, (GLenum target, GLuint renderbuffer)) \
499 F(void, BlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)) \
500 F(void, BlendEquation, (GLenum mode)) \
501 F(void, BlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha)) \
502 F(void, BlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)) \
503 F(void, BufferData, (GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)) \
504 F(void, BufferSubData, (GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)) \
505 F(GLenum, CheckFramebufferStatus, (GLenum target)) \
506 F(void, CompileShader, (GLuint shader)) \
507 F(void, CompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)) \
508 F(void, CompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)) \
509 F(GLuint, CreateProgram, ()) \
510 F(GLuint, CreateShader, (GLenum type)) \
511 F(void, DeleteBuffers, (GLsizei n, const GLuint* buffers)) \
512 F(void, DeleteFramebuffers, (GLsizei n, const GLuint* framebuffers)) \
513 F(void, DeleteProgram, (GLuint program)) \
514 F(void, DeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers)) \
515 F(void, DeleteShader, (GLuint shader)) \
516 F(void, DetachShader, (GLuint program, GLuint shader)) \
517 F(void, DisableVertexAttribArray, (GLuint index)) \
518 F(void, EnableVertexAttribArray, (GLuint index)) \
519 F(void, FramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) \
520 F(void, FramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) \
521 F(void, GenBuffers, (GLsizei n, GLuint* buffers)) \
522 F(void, GenerateMipmap, (GLenum target)) \
523 F(void, GenFramebuffers, (GLsizei n, GLuint* framebuffers)) \
524 F(void, GenRenderbuffers, (GLsizei n, GLuint* renderbuffers)) \
525 F(void, GetActiveAttrib, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)) \
526 F(void, GetActiveUniform, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)) \
527 F(void, GetAttachedShaders, (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)) \
528 F(GLint, GetAttribLocation, (GLuint program, const char* name)) \
529 F(void, GetBufferParameteriv, (GLenum target, GLenum pname, GLint* params)) \
530 F(void, GetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params)) \
531 F(void, GetProgramiv, (GLuint program, GLenum pname, GLint* params)) \
532 F(void, GetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)) \
533 F(void, GetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params)) \
534 F(void, GetShaderiv, (GLuint shader, GLenum pname, GLint* params)) \
535 F(void, GetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)) \
536 F(void, GetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)) \
537 F(void, GetShaderSource, (GLuint shader, GLsizei bufsize, GLsizei* length, char* source)) \
538 F(void, GetUniformfv, (GLuint program, GLint location, GLfloat* params)) \
539 F(void, GetUniformiv, (GLuint program, GLint location, GLint* params)) \
540 F(GLint, GetUniformLocation, (GLuint program, const char* name)) \
541 F(void, GetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params)) \
542 F(void, GetVertexAttribiv, (GLuint index, GLenum pname, GLint* params)) \
543 F(void, GetVertexAttribPointerv, (GLuint index, GLenum pname, void** pointer)) \
544 F(GLboolean, IsBuffer, (GLuint buffer)) \
545 F(GLboolean, IsFramebuffer, (GLuint framebuffer)) \
546 F(GLboolean, IsProgram, (GLuint program)) \
547 F(GLboolean, IsRenderbuffer, (GLuint renderbuffer)) \
548 F(GLboolean, IsShader, (GLuint shader)) \
549 F(void, LinkProgram, (GLuint program)) \
550 F(void, ReleaseShaderCompiler, ()) \
551 F(void, RenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) \
552 F(void, SampleCoverage, (GLclampf value, GLboolean invert)) \
553 F(void, ShaderBinary, (GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)) \
554 F(void, ShaderSource, (GLuint shader, GLsizei count, const char** string, const GLint* length)) \
555 F(void, StencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask)) \
556 F(void, StencilMaskSeparate, (GLenum face, GLuint mask)) \
557 F(void, StencilOpSeparate, (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)) \
558 F(void, Uniform1f, (GLint location, GLfloat x)) \
559 F(void, Uniform1fv, (GLint location, GLsizei count, const GLfloat* v)) \
560 F(void, Uniform1i, (GLint location, GLint x)) \
561 F(void, Uniform1iv, (GLint location, GLsizei count, const GLint* v)) \
562 F(void, Uniform2f, (GLint location, GLfloat x, GLfloat y)) \
563 F(void, Uniform2fv, (GLint location, GLsizei count, const GLfloat* v)) \
564 F(void, Uniform2i, (GLint location, GLint x, GLint y)) \
565 F(void, Uniform2iv, (GLint location, GLsizei count, const GLint* v)) \
566 F(void, Uniform3f, (GLint location, GLfloat x, GLfloat y, GLfloat z)) \
567 F(void, Uniform3fv, (GLint location, GLsizei count, const GLfloat* v)) \
568 F(void, Uniform3i, (GLint location, GLint x, GLint y, GLint z)) \
569 F(void, Uniform3iv, (GLint location, GLsizei count, const GLint* v)) \
570 F(void, Uniform4f, (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) \
571 F(void, Uniform4fv, (GLint location, GLsizei count, const GLfloat* v)) \
572 F(void, Uniform4i, (GLint location, GLint x, GLint y, GLint z, GLint w)) \
573 F(void, Uniform4iv, (GLint location, GLsizei count, const GLint* v)) \
574 F(void, UniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)) \
575 F(void, UniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)) \
576 F(void, UniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)) \
577 F(void, UseProgram, (GLuint program)) \
578 F(void, ValidateProgram, (GLuint program)) \
579 F(void, VertexAttrib1f, (GLuint indx, GLfloat x)) \
580 F(void, VertexAttrib1fv, (GLuint indx, const GLfloat* values)) \
581 F(void, VertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y)) \
582 F(void, VertexAttrib2fv, (GLuint indx, const GLfloat* values)) \
583 F(void, VertexAttrib3f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z)) \
584 F(void, VertexAttrib3fv, (GLuint indx, const GLfloat* values)) \
585 F(void, VertexAttrib4f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) \
586 F(void, VertexAttrib4fv, (GLuint indx, const GLfloat* values)) \
587 F(void, VertexAttribPointer, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)) \
588 F(void, ClearDepth, (GLdouble depth)) \
589 F(void, DepthRange, (GLdouble zNear, GLdouble zFar)) \
590
591 QT_OPENGL_DECLARE(QT_OPENGL_FUNCTIONS)
592};
593
594// GLES2 + OpenGL1 common subset
595
596inline void QOpenGLFunctions::glBindTexture(GLenum target, GLuint texture)
597{
598#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
599 ::glBindTexture(target, texture);
600#else
601 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
602 d_ptr->f.BindTexture(target, texture);
603#endif
604 Q_OPENGL_FUNCTIONS_DEBUG
605}
606
607inline void QOpenGLFunctions::glBlendFunc(GLenum sfactor, GLenum dfactor)
608{
609#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
610 ::glBlendFunc(sfactor, dfactor);
611#else
612 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
613 d_ptr->f.BlendFunc(sfactor, dfactor);
614#endif
615 Q_OPENGL_FUNCTIONS_DEBUG
616}
617
618inline void QOpenGLFunctions::glClear(GLbitfield mask)
619{
620#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
621 ::glClear(mask);
622#else
623 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
624 d_ptr->f.Clear(mask);
625#endif
626 Q_OPENGL_FUNCTIONS_DEBUG
627}
628
629inline void QOpenGLFunctions::glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
630{
631#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
632 ::glClearColor(red, green, blue, alpha);
633#else
634 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
635 d_ptr->f.ClearColor(red, green, blue, alpha);
636#endif
637 Q_OPENGL_FUNCTIONS_DEBUG
638}
639
640inline void QOpenGLFunctions::glClearStencil(GLint s)
641{
642#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
643 ::glClearStencil(s);
644#else
645 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
646 d_ptr->f.ClearStencil(s);
647#endif
648 Q_OPENGL_FUNCTIONS_DEBUG
649}
650
651inline void QOpenGLFunctions::glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
652{
653#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
654 ::glColorMask(red, green, blue, alpha);
655#else
656 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
657 d_ptr->f.ColorMask(red, green, blue, alpha);
658#endif
659 Q_OPENGL_FUNCTIONS_DEBUG
660}
661
662inline void QOpenGLFunctions::glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
663{
664#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
665 ::glCopyTexImage2D(target, level, internalformat, x, y, width,height, border);
666#else
667 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
668 d_ptr->f.CopyTexImage2D(target, level, internalformat, x, y, width,height, border);
669#endif
670 Q_OPENGL_FUNCTIONS_DEBUG
671}
672
673inline void QOpenGLFunctions::glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
674{
675#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
676 ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
677#else
678 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
679 d_ptr->f.CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
680#endif
681 Q_OPENGL_FUNCTIONS_DEBUG
682}
683
684inline void QOpenGLFunctions::glCullFace(GLenum mode)
685{
686#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
687 ::glCullFace(mode);
688#else
689 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
690 d_ptr->f.CullFace(mode);
691#endif
692 Q_OPENGL_FUNCTIONS_DEBUG
693}
694
695inline void QOpenGLFunctions::glDeleteTextures(GLsizei n, const GLuint* textures)
696{
697#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
698 ::glDeleteTextures(n, textures);
699#else
700 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
701 d_ptr->f.DeleteTextures(n, textures);
702#endif
703 Q_OPENGL_FUNCTIONS_DEBUG
704}
705
706inline void QOpenGLFunctions::glDepthFunc(GLenum func)
707{
708#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
709 ::glDepthFunc(func);
710#else
711 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
712 d_ptr->f.DepthFunc(func);
713#endif
714 Q_OPENGL_FUNCTIONS_DEBUG
715}
716
717inline void QOpenGLFunctions::glDepthMask(GLboolean flag)
718{
719#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
720 ::glDepthMask(flag);
721#else
722 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
723 d_ptr->f.DepthMask(flag);
724#endif
725 Q_OPENGL_FUNCTIONS_DEBUG
726}
727
728inline void QOpenGLFunctions::glDisable(GLenum cap)
729{
730#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
731 ::glDisable(cap);
732#else
733 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
734 d_ptr->f.Disable(cap);
735#endif
736 Q_OPENGL_FUNCTIONS_DEBUG
737}
738
739inline void QOpenGLFunctions::glDrawArrays(GLenum mode, GLint first, GLsizei count)
740{
741#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
742 ::glDrawArrays(mode, first, count);
743#else
744 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
745 d_ptr->f.DrawArrays(mode, first, count);
746#endif
747 Q_OPENGL_FUNCTIONS_DEBUG
748}
749
750inline void QOpenGLFunctions::glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
751{
752#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
753 ::glDrawElements(mode, count, type, indices);
754#else
755 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
756 d_ptr->f.DrawElements(mode, count, type, indices);
757#endif
758 Q_OPENGL_FUNCTIONS_DEBUG
759}
760
761inline void QOpenGLFunctions::glEnable(GLenum cap)
762{
763#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
764 ::glEnable(cap);
765#else
766 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
767 d_ptr->f.Enable(cap);
768#endif
769 Q_OPENGL_FUNCTIONS_DEBUG
770}
771
772inline void QOpenGLFunctions::glFinish()
773{
774#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
775 ::glFinish();
776#else
777 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
778 d_ptr->f.Finish();
779#endif
780 Q_OPENGL_FUNCTIONS_DEBUG
781}
782
783inline void QOpenGLFunctions::glFlush()
784{
785#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
786 ::glFlush();
787#else
788 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
789 d_ptr->f.Flush();
790#endif
791 Q_OPENGL_FUNCTIONS_DEBUG
792}
793
794inline void QOpenGLFunctions::glFrontFace(GLenum mode)
795{
796#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
797 ::glFrontFace(mode);
798#else
799 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
800 d_ptr->f.FrontFace(mode);
801#endif
802 Q_OPENGL_FUNCTIONS_DEBUG
803}
804
805inline void QOpenGLFunctions::glGenTextures(GLsizei n, GLuint* textures)
806{
807#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
808 ::glGenTextures(n, textures);
809#else
810 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
811 d_ptr->f.GenTextures(n, textures);
812#endif
813 Q_OPENGL_FUNCTIONS_DEBUG
814}
815
816inline void QOpenGLFunctions::glGetBooleanv(GLenum pname, GLboolean* params)
817{
818#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
819 ::glGetBooleanv(pname, params);
820#else
821 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
822 d_ptr->f.GetBooleanv(pname, params);
823#endif
824 Q_OPENGL_FUNCTIONS_DEBUG
825}
826
827inline GLenum QOpenGLFunctions::glGetError()
828{
829#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
830 GLenum result = ::glGetError();
831#else
832 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
833 GLenum result = d_ptr->f.GetError();
834#endif
835 return result;
836}
837
838inline void QOpenGLFunctions::glGetFloatv(GLenum pname, GLfloat* params)
839{
840#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
841 ::glGetFloatv(pname, params);
842#else
843 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
844 d_ptr->f.GetFloatv(pname, params);
845#endif
846 Q_OPENGL_FUNCTIONS_DEBUG
847}
848
849inline void QOpenGLFunctions::glGetIntegerv(GLenum pname, GLint* params)
850{
851#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
852 ::glGetIntegerv(pname, params);
853#else
854 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
855 d_ptr->f.GetIntegerv(pname, params);
856#endif
857 Q_OPENGL_FUNCTIONS_DEBUG
858}
859
860inline const GLubyte *QOpenGLFunctions::glGetString(GLenum name)
861{
862#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
863 const GLubyte *result = ::glGetString(name);
864#else
865 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
866 const GLubyte *result = d_ptr->f.GetString(name);
867#endif
868 Q_OPENGL_FUNCTIONS_DEBUG
869 return result;
870}
871
872inline void QOpenGLFunctions::glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
873{
874#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
875 ::glGetTexParameterfv(target, pname, params);
876#else
877 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
878 d_ptr->f.GetTexParameterfv(target, pname, params);
879#endif
880 Q_OPENGL_FUNCTIONS_DEBUG
881}
882
883inline void QOpenGLFunctions::glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
884{
885#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
886 ::glGetTexParameteriv(target, pname, params);
887#else
888 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
889 d_ptr->f.GetTexParameteriv(target, pname, params);
890#endif
891 Q_OPENGL_FUNCTIONS_DEBUG
892}
893
894inline void QOpenGLFunctions::glHint(GLenum target, GLenum mode)
895{
896#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
897 ::glHint(target, mode);
898#else
899 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
900 d_ptr->f.Hint(target, mode);
901#endif
902 Q_OPENGL_FUNCTIONS_DEBUG
903}
904
905inline GLboolean QOpenGLFunctions::glIsEnabled(GLenum cap)
906{
907#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
908 GLboolean result = ::glIsEnabled(cap);
909#else
910 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
911 GLboolean result = d_ptr->f.IsEnabled(cap);
912#endif
913 Q_OPENGL_FUNCTIONS_DEBUG
914 return result;
915}
916
917inline GLboolean QOpenGLFunctions::glIsTexture(GLuint texture)
918{
919#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
920 GLboolean result = ::glIsTexture(texture);
921#else
922 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
923 GLboolean result = d_ptr->f.IsTexture(texture);
924#endif
925 Q_OPENGL_FUNCTIONS_DEBUG
926 return result;
927}
928
929inline void QOpenGLFunctions::glLineWidth(GLfloat width)
930{
931#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
932 ::glLineWidth(width);
933#else
934 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
935 d_ptr->f.LineWidth(width);
936#endif
937 Q_OPENGL_FUNCTIONS_DEBUG
938}
939
940inline void QOpenGLFunctions::glPixelStorei(GLenum pname, GLint param)
941{
942#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
943 ::glPixelStorei(pname, param);
944#else
945 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
946 d_ptr->f.PixelStorei(pname, param);
947#endif
948 Q_OPENGL_FUNCTIONS_DEBUG
949}
950
951inline void QOpenGLFunctions::glPolygonOffset(GLfloat factor, GLfloat units)
952{
953#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
954 ::glPolygonOffset(factor, units);
955#else
956 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
957 d_ptr->f.PolygonOffset(factor, units);
958#endif
959 Q_OPENGL_FUNCTIONS_DEBUG
960}
961
962inline void QOpenGLFunctions::glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
963{
964#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
965 ::glReadPixels(x, y, width, height, format, type, pixels);
966#else
967 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
968 d_ptr->f.ReadPixels(x, y, width, height, format, type, pixels);
969#endif
970 Q_OPENGL_FUNCTIONS_DEBUG
971}
972
973inline void QOpenGLFunctions::glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
974{
975#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
976 ::glScissor(x, y, width, height);
977#else
978 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
979 d_ptr->f.Scissor(x, y, width, height);
980#endif
981 Q_OPENGL_FUNCTIONS_DEBUG
982}
983
984inline void QOpenGLFunctions::glStencilFunc(GLenum func, GLint ref, GLuint mask)
985{
986#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
987 ::glStencilFunc(func, ref, mask);
988#else
989 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
990 d_ptr->f.StencilFunc(func, ref, mask);
991#endif
992 Q_OPENGL_FUNCTIONS_DEBUG
993}
994
995inline void QOpenGLFunctions::glStencilMask(GLuint mask)
996{
997#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
998 ::glStencilMask(mask);
999#else
1000 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1001 d_ptr->f.StencilMask(mask);
1002#endif
1003 Q_OPENGL_FUNCTIONS_DEBUG
1004}
1005
1006inline void QOpenGLFunctions::glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
1007{
1008#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1009 ::glStencilOp(fail, zfail, zpass);
1010#else
1011 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1012 d_ptr->f.StencilOp(fail, zfail, zpass);
1013#endif
1014 Q_OPENGL_FUNCTIONS_DEBUG
1015}
1016
1017inline void QOpenGLFunctions::glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1018{
1019#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1020 ::glTexImage2D(target, level, internalformat, width,height, border, format, type, pixels);
1021#else
1022 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1023 d_ptr->f.TexImage2D(target, level, internalformat, width,height, border, format, type, pixels);
1024#endif
1025 Q_OPENGL_FUNCTIONS_DEBUG
1026}
1027
1028inline void QOpenGLFunctions::glTexParameterf(GLenum target, GLenum pname, GLfloat param)
1029{
1030#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1031 ::glTexParameterf(target, pname, param);
1032#else
1033 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1034 d_ptr->f.TexParameterf(target, pname, param);
1035#endif
1036 Q_OPENGL_FUNCTIONS_DEBUG
1037}
1038
1039inline void QOpenGLFunctions::glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
1040{
1041#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1042 ::glTexParameterfv(target, pname, params);
1043#else
1044 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1045 d_ptr->f.TexParameterfv(target, pname, params);
1046#endif
1047 Q_OPENGL_FUNCTIONS_DEBUG
1048}
1049
1050inline void QOpenGLFunctions::glTexParameteri(GLenum target, GLenum pname, GLint param)
1051{
1052#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1053 ::glTexParameteri(target, pname, param);
1054#else
1055 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1056 d_ptr->f.TexParameteri(target, pname, param);
1057#endif
1058 Q_OPENGL_FUNCTIONS_DEBUG
1059}
1060
1061inline void QOpenGLFunctions::glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
1062{
1063#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1064 ::glTexParameteriv(target, pname, params);
1065#else
1066 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1067 d_ptr->f.TexParameteriv(target, pname, params);
1068#endif
1069 Q_OPENGL_FUNCTIONS_DEBUG
1070}
1071
1072inline void QOpenGLFunctions::glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
1073{
1074#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1075 ::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
1076#else
1077 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1078 d_ptr->f.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
1079#endif
1080 Q_OPENGL_FUNCTIONS_DEBUG
1081}
1082
1083inline void QOpenGLFunctions::glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
1084{
1085#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1086 ::glViewport(x, y, width, height);
1087#else
1088 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1089 d_ptr->f.Viewport(x, y, width, height);
1090#endif
1091 Q_OPENGL_FUNCTIONS_DEBUG
1092}
1093
1094// GL(ES)2
1095
1096inline void QOpenGLFunctions::glActiveTexture(GLenum texture)
1097{
1098#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1099 ::glActiveTexture(texture);
1100#else
1101 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1102 d_ptr->f.ActiveTexture(texture);
1103#endif
1104 Q_OPENGL_FUNCTIONS_DEBUG
1105}
1106
1107inline void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
1108{
1109#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1110 ::glAttachShader(program, shader);
1111#else
1112 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1113 d_ptr->f.AttachShader(program, shader);
1114#endif
1115 Q_OPENGL_FUNCTIONS_DEBUG
1116}
1117
1118inline void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
1119{
1120#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1121 ::glBindAttribLocation(program, index, name);
1122#else
1123 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1124 d_ptr->f.BindAttribLocation(program, index, name);
1125#endif
1126 Q_OPENGL_FUNCTIONS_DEBUG
1127}
1128
1129inline void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
1130{
1131#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1132 ::glBindBuffer(target, buffer);
1133#else
1134 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1135 d_ptr->f.BindBuffer(target, buffer);
1136#endif
1137 Q_OPENGL_FUNCTIONS_DEBUG
1138}
1139
1140inline void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
1141{
1142 if (framebuffer == 0)
1143 framebuffer = QOpenGLContext::currentContext()->defaultFramebufferObject();
1144#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1145 ::glBindFramebuffer(target, framebuffer);
1146#else
1147 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1148 d_ptr->f.BindFramebuffer(target, framebuffer);
1149#endif
1150 Q_OPENGL_FUNCTIONS_DEBUG
1151}
1152
1153inline void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
1154{
1155#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1156 ::glBindRenderbuffer(target, renderbuffer);
1157#else
1158 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1159 d_ptr->f.BindRenderbuffer(target, renderbuffer);
1160#endif
1161 Q_OPENGL_FUNCTIONS_DEBUG
1162}
1163
1164inline void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1165{
1166#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1167 ::glBlendColor(red, green, blue, alpha);
1168#else
1169 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1170 d_ptr->f.BlendColor(red, green, blue, alpha);
1171#endif
1172 Q_OPENGL_FUNCTIONS_DEBUG
1173}
1174
1175inline void QOpenGLFunctions::glBlendEquation(GLenum mode)
1176{
1177#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1178 ::glBlendEquation(mode);
1179#else
1180 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1181 d_ptr->f.BlendEquation(mode);
1182#endif
1183 Q_OPENGL_FUNCTIONS_DEBUG
1184}
1185
1186inline void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1187{
1188#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1189 ::glBlendEquationSeparate(modeRGB, modeAlpha);
1190#else
1191 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1192 d_ptr->f.BlendEquationSeparate(modeRGB, modeAlpha);
1193#endif
1194 Q_OPENGL_FUNCTIONS_DEBUG
1195}
1196
1197inline void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1198{
1199#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1200 ::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1201#else
1202 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1203 d_ptr->f.BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
1204#endif
1205 Q_OPENGL_FUNCTIONS_DEBUG
1206}
1207
1208inline void QOpenGLFunctions::glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
1209{
1210#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1211 ::glBufferData(target, size, data, usage);
1212#else
1213 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1214 d_ptr->f.BufferData(target, size, data, usage);
1215#endif
1216 Q_OPENGL_FUNCTIONS_DEBUG
1217}
1218
1219inline void QOpenGLFunctions::glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
1220{
1221#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1222 ::glBufferSubData(target, offset, size, data);
1223#else
1224 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1225 d_ptr->f.BufferSubData(target, offset, size, data);
1226#endif
1227 Q_OPENGL_FUNCTIONS_DEBUG
1228}
1229
1230inline GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
1231{
1232#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1233 GLenum result = ::glCheckFramebufferStatus(target);
1234#else
1235 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1236 GLenum result = d_ptr->f.CheckFramebufferStatus(target);
1237#endif
1238 Q_OPENGL_FUNCTIONS_DEBUG
1239 return result;
1240}
1241
1242inline void QOpenGLFunctions::glClearDepthf(GLclampf depth)
1243{
1244#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1245 ::glClearDepthf(depth);
1246#else
1247 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1248 d_ptr->f.ClearDepthf(depth);
1249#endif
1250 Q_OPENGL_FUNCTIONS_DEBUG
1251}
1252
1253inline void QOpenGLFunctions::glCompileShader(GLuint shader)
1254{
1255#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1256 ::glCompileShader(shader);
1257#else
1258 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1259 d_ptr->f.CompileShader(shader);
1260#endif
1261 Q_OPENGL_FUNCTIONS_DEBUG
1262}
1263
1264inline void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
1265{
1266#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1267 ::glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1268#else
1269 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1270 d_ptr->f.CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
1271#endif
1272 Q_OPENGL_FUNCTIONS_DEBUG
1273}
1274
1275inline void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
1276{
1277#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1278 ::glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1279#else
1280 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1281 d_ptr->f.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
1282#endif
1283 Q_OPENGL_FUNCTIONS_DEBUG
1284}
1285
1286inline GLuint QOpenGLFunctions::glCreateProgram()
1287{
1288#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1289 GLuint result = ::glCreateProgram();
1290#else
1291 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1292 GLuint result = d_ptr->f.CreateProgram();
1293#endif
1294 Q_OPENGL_FUNCTIONS_DEBUG
1295 return result;
1296}
1297
1298inline GLuint QOpenGLFunctions::glCreateShader(GLenum type)
1299{
1300#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1301 GLuint result = ::glCreateShader(type);
1302#else
1303 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1304 GLuint result = d_ptr->f.CreateShader(type);
1305#endif
1306 Q_OPENGL_FUNCTIONS_DEBUG
1307 return result;
1308}
1309
1310inline void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
1311{
1312#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1313 ::glDeleteBuffers(n, buffers);
1314#else
1315 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1316 d_ptr->f.DeleteBuffers(n, buffers);
1317#endif
1318 Q_OPENGL_FUNCTIONS_DEBUG
1319}
1320
1321inline void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
1322{
1323#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1324 ::glDeleteFramebuffers(n, framebuffers);
1325#else
1326 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1327 d_ptr->f.DeleteFramebuffers(n, framebuffers);
1328#endif
1329 Q_OPENGL_FUNCTIONS_DEBUG
1330}
1331
1332inline void QOpenGLFunctions::glDeleteProgram(GLuint program)
1333{
1334#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1335 ::glDeleteProgram(program);
1336#else
1337 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1338 d_ptr->f.DeleteProgram(program);
1339#endif
1340 Q_OPENGL_FUNCTIONS_DEBUG
1341}
1342
1343inline void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
1344{
1345#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1346 ::glDeleteRenderbuffers(n, renderbuffers);
1347#else
1348 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1349 d_ptr->f.DeleteRenderbuffers(n, renderbuffers);
1350#endif
1351 Q_OPENGL_FUNCTIONS_DEBUG
1352}
1353
1354inline void QOpenGLFunctions::glDeleteShader(GLuint shader)
1355{
1356#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1357 ::glDeleteShader(shader);
1358#else
1359 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1360 d_ptr->f.DeleteShader(shader);
1361#endif
1362 Q_OPENGL_FUNCTIONS_DEBUG
1363}
1364
1365inline void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
1366{
1367#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1368 ::glDepthRangef(zNear, zFar);
1369#else
1370 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1371 d_ptr->f.DepthRangef(zNear, zFar);
1372#endif
1373 Q_OPENGL_FUNCTIONS_DEBUG
1374}
1375
1376inline void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
1377{
1378#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1379 ::glDetachShader(program, shader);
1380#else
1381 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1382 d_ptr->f.DetachShader(program, shader);
1383#endif
1384 Q_OPENGL_FUNCTIONS_DEBUG
1385}
1386
1387inline void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
1388{
1389#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1390 ::glDisableVertexAttribArray(index);
1391#else
1392 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1393 d_ptr->f.DisableVertexAttribArray(index);
1394#endif
1395 Q_OPENGL_FUNCTIONS_DEBUG
1396}
1397
1398inline void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
1399{
1400#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1401 ::glEnableVertexAttribArray(index);
1402#else
1403 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1404 d_ptr->f.EnableVertexAttribArray(index);
1405#endif
1406 Q_OPENGL_FUNCTIONS_DEBUG
1407}
1408
1409inline void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1410{
1411#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1412 ::glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
1413#else
1414 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1415 d_ptr->f.FramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
1416#endif
1417 Q_OPENGL_FUNCTIONS_DEBUG
1418}
1419
1420inline void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1421{
1422#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1423 ::glFramebufferTexture2D(target, attachment, textarget, texture, level);
1424#else
1425 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1426 d_ptr->f.FramebufferTexture2D(target, attachment, textarget, texture, level);
1427#endif
1428 Q_OPENGL_FUNCTIONS_DEBUG
1429}
1430
1431inline void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
1432{
1433#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1434 ::glGenBuffers(n, buffers);
1435#else
1436 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1437 d_ptr->f.GenBuffers(n, buffers);
1438#endif
1439 Q_OPENGL_FUNCTIONS_DEBUG
1440}
1441
1442inline void QOpenGLFunctions::glGenerateMipmap(GLenum target)
1443{
1444#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1445 ::glGenerateMipmap(target);
1446#else
1447 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1448 d_ptr->f.GenerateMipmap(target);
1449#endif
1450 Q_OPENGL_FUNCTIONS_DEBUG
1451}
1452
1453inline void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
1454{
1455#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1456 ::glGenFramebuffers(n, framebuffers);
1457#else
1458 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1459 d_ptr->f.GenFramebuffers(n, framebuffers);
1460#endif
1461 Q_OPENGL_FUNCTIONS_DEBUG
1462}
1463
1464inline void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
1465{
1466#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1467 ::glGenRenderbuffers(n, renderbuffers);
1468#else
1469 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1470 d_ptr->f.GenRenderbuffers(n, renderbuffers);
1471#endif
1472 Q_OPENGL_FUNCTIONS_DEBUG
1473}
1474
1475inline void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
1476{
1477#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1478 ::glGetActiveAttrib(program, index, bufsize, length, size, type, name);
1479#else
1480 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1481 d_ptr->f.GetActiveAttrib(program, index, bufsize, length, size, type, name);
1482#endif
1483 Q_OPENGL_FUNCTIONS_DEBUG
1484}
1485
1486inline void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
1487{
1488#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1489 ::glGetActiveUniform(program, index, bufsize, length, size, type, name);
1490#else
1491 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1492 d_ptr->f.GetActiveUniform(program, index, bufsize, length, size, type, name);
1493#endif
1494 Q_OPENGL_FUNCTIONS_DEBUG
1495}
1496
1497inline void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
1498{
1499#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1500 ::glGetAttachedShaders(program, maxcount, count, shaders);
1501#else
1502 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1503 d_ptr->f.GetAttachedShaders(program, maxcount, count, shaders);
1504#endif
1505 Q_OPENGL_FUNCTIONS_DEBUG
1506}
1507
1508inline GLint QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
1509{
1510#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1511 GLint result = ::glGetAttribLocation(program, name);
1512#else
1513 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1514 GLint result = d_ptr->f.GetAttribLocation(program, name);
1515#endif
1516 Q_OPENGL_FUNCTIONS_DEBUG
1517 return result;
1518}
1519
1520inline void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
1521{
1522#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1523 ::glGetBufferParameteriv(target, pname, params);
1524#else
1525 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1526 d_ptr->f.GetBufferParameteriv(target, pname, params);
1527#endif
1528 Q_OPENGL_FUNCTIONS_DEBUG
1529}
1530
1531inline void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
1532{
1533#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1534 ::glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
1535#else
1536 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1537 d_ptr->f.GetFramebufferAttachmentParameteriv(target, attachment, pname, params);
1538#endif
1539 Q_OPENGL_FUNCTIONS_DEBUG
1540}
1541
1542inline void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
1543{
1544#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1545 ::glGetProgramiv(program, pname, params);
1546#else
1547 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1548 d_ptr->f.GetProgramiv(program, pname, params);
1549#endif
1550 Q_OPENGL_FUNCTIONS_DEBUG
1551}
1552
1553inline void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
1554{
1555#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1556 ::glGetProgramInfoLog(program, bufsize, length, infolog);
1557#else
1558 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1559 d_ptr->f.GetProgramInfoLog(program, bufsize, length, infolog);
1560#endif
1561 Q_OPENGL_FUNCTIONS_DEBUG
1562}
1563
1564inline void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
1565{
1566#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1567 ::glGetRenderbufferParameteriv(target, pname, params);
1568#else
1569 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1570 d_ptr->f.GetRenderbufferParameteriv(target, pname, params);
1571#endif
1572 Q_OPENGL_FUNCTIONS_DEBUG
1573}
1574
1575inline void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
1576{
1577#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1578 ::glGetShaderiv(shader, pname, params);
1579#else
1580 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1581 d_ptr->f.GetShaderiv(shader, pname, params);
1582#endif
1583 Q_OPENGL_FUNCTIONS_DEBUG
1584}
1585
1586inline void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
1587{
1588#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1589 ::glGetShaderInfoLog(shader, bufsize, length, infolog);
1590#else
1591 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1592 d_ptr->f.GetShaderInfoLog(shader, bufsize, length, infolog);
1593#endif
1594 Q_OPENGL_FUNCTIONS_DEBUG
1595}
1596
1597inline void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
1598{
1599#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1600 ::glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
1601#else
1602 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1603 d_ptr->f.GetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
1604#endif
1605 Q_OPENGL_FUNCTIONS_DEBUG
1606}
1607
1608inline void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
1609{
1610#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1611 ::glGetShaderSource(shader, bufsize, length, source);
1612#else
1613 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1614 d_ptr->f.GetShaderSource(shader, bufsize, length, source);
1615#endif
1616 Q_OPENGL_FUNCTIONS_DEBUG
1617}
1618
1619inline void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
1620{
1621#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1622 ::glGetUniformfv(program, location, params);
1623#else
1624 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1625 d_ptr->f.GetUniformfv(program, location, params);
1626#endif
1627 Q_OPENGL_FUNCTIONS_DEBUG
1628}
1629
1630inline void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
1631{
1632#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1633 ::glGetUniformiv(program, location, params);
1634#else
1635 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1636 d_ptr->f.GetUniformiv(program, location, params);
1637#endif
1638 Q_OPENGL_FUNCTIONS_DEBUG
1639}
1640
1641inline GLint QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
1642{
1643#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1644 GLint result = ::glGetUniformLocation(program, name);
1645#else
1646 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1647 GLint result = d_ptr->f.GetUniformLocation(program, name);
1648#endif
1649 Q_OPENGL_FUNCTIONS_DEBUG
1650 return result;
1651}
1652
1653inline void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
1654{
1655#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1656 ::glGetVertexAttribfv(index, pname, params);
1657#else
1658 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1659 d_ptr->f.GetVertexAttribfv(index, pname, params);
1660#endif
1661 Q_OPENGL_FUNCTIONS_DEBUG
1662}
1663
1664inline void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
1665{
1666#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1667 ::glGetVertexAttribiv(index, pname, params);
1668#else
1669 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1670 d_ptr->f.GetVertexAttribiv(index, pname, params);
1671#endif
1672 Q_OPENGL_FUNCTIONS_DEBUG
1673}
1674
1675inline void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
1676{
1677#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1678 ::glGetVertexAttribPointerv(index, pname, pointer);
1679#else
1680 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1681 d_ptr->f.GetVertexAttribPointerv(index, pname, pointer);
1682#endif
1683 Q_OPENGL_FUNCTIONS_DEBUG
1684}
1685
1686inline GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
1687{
1688#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1689 GLboolean result = ::glIsBuffer(buffer);
1690#else
1691 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1692 GLboolean result = d_ptr->f.IsBuffer(buffer);
1693#endif
1694 Q_OPENGL_FUNCTIONS_DEBUG
1695 return result;
1696}
1697
1698inline GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
1699{
1700#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1701 GLboolean result = ::glIsFramebuffer(framebuffer);
1702#else
1703 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1704 GLboolean result = d_ptr->f.IsFramebuffer(framebuffer);
1705#endif
1706 Q_OPENGL_FUNCTIONS_DEBUG
1707 return result;
1708}
1709
1710inline GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
1711{
1712#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1713 GLboolean result = ::glIsProgram(program);
1714#else
1715 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1716 GLboolean result = d_ptr->f.IsProgram(program);
1717#endif
1718 Q_OPENGL_FUNCTIONS_DEBUG
1719 return result;
1720}
1721
1722inline GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
1723{
1724#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1725 GLboolean result = ::glIsRenderbuffer(renderbuffer);
1726#else
1727 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1728 GLboolean result = d_ptr->f.IsRenderbuffer(renderbuffer);
1729#endif
1730 Q_OPENGL_FUNCTIONS_DEBUG
1731 return result;
1732}
1733
1734inline GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
1735{
1736#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1737 GLboolean result = ::glIsShader(shader);
1738#else
1739 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1740 GLboolean result = d_ptr->f.IsShader(shader);
1741#endif
1742 Q_OPENGL_FUNCTIONS_DEBUG
1743 return result;
1744}
1745
1746inline void QOpenGLFunctions::glLinkProgram(GLuint program)
1747{
1748#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1749 ::glLinkProgram(program);
1750#else
1751 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1752 d_ptr->f.LinkProgram(program);
1753#endif
1754 Q_OPENGL_FUNCTIONS_DEBUG
1755}
1756
1757inline void QOpenGLFunctions::glReleaseShaderCompiler()
1758{
1759#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1760 ::glReleaseShaderCompiler();
1761#else
1762 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1763 d_ptr->f.ReleaseShaderCompiler();
1764#endif
1765 Q_OPENGL_FUNCTIONS_DEBUG
1766}
1767
1768inline void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1769{
1770#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1771 ::glRenderbufferStorage(target, internalformat, width, height);
1772#else
1773 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1774 d_ptr->f.RenderbufferStorage(target, internalformat, width, height);
1775#endif
1776 Q_OPENGL_FUNCTIONS_DEBUG
1777}
1778
1779inline void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
1780{
1781#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1782 ::glSampleCoverage(value, invert);
1783#else
1784 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1785 d_ptr->f.SampleCoverage(value, invert);
1786#endif
1787 Q_OPENGL_FUNCTIONS_DEBUG
1788}
1789
1790inline void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
1791{
1792#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1793 ::glShaderBinary(n, shaders, binaryformat, binary, length);
1794#else
1795 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1796 d_ptr->f.ShaderBinary(n, shaders, binaryformat, binary, length);
1797#endif
1798 Q_OPENGL_FUNCTIONS_DEBUG
1799}
1800
1801inline void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
1802{
1803#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1804 ::glShaderSource(shader, count, string, length);
1805#else
1806 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1807 d_ptr->f.ShaderSource(shader, count, string, length);
1808#endif
1809 Q_OPENGL_FUNCTIONS_DEBUG
1810}
1811
1812inline void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1813{
1814#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1815 ::glStencilFuncSeparate(face, func, ref, mask);
1816#else
1817 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1818 d_ptr->f.StencilFuncSeparate(face, func, ref, mask);
1819#endif
1820 Q_OPENGL_FUNCTIONS_DEBUG
1821}
1822
1823inline void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
1824{
1825#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1826 ::glStencilMaskSeparate(face, mask);
1827#else
1828 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1829 d_ptr->f.StencilMaskSeparate(face, mask);
1830#endif
1831 Q_OPENGL_FUNCTIONS_DEBUG
1832}
1833
1834inline void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1835{
1836#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1837 ::glStencilOpSeparate(face, fail, zfail, zpass);
1838#else
1839 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1840 d_ptr->f.StencilOpSeparate(face, fail, zfail, zpass);
1841#endif
1842 Q_OPENGL_FUNCTIONS_DEBUG
1843}
1844
1845inline void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
1846{
1847#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1848 ::glUniform1f(location, x);
1849#else
1850 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1851 d_ptr->f.Uniform1f(location, x);
1852#endif
1853 Q_OPENGL_FUNCTIONS_DEBUG
1854}
1855
1856inline void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1857{
1858#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1859 ::glUniform1fv(location, count, v);
1860#else
1861 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1862 d_ptr->f.Uniform1fv(location, count, v);
1863#endif
1864 Q_OPENGL_FUNCTIONS_DEBUG
1865}
1866
1867inline void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
1868{
1869#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1870 ::glUniform1i(location, x);
1871#else
1872 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1873 d_ptr->f.Uniform1i(location, x);
1874#endif
1875 Q_OPENGL_FUNCTIONS_DEBUG
1876}
1877
1878inline void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
1879{
1880#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1881 ::glUniform1iv(location, count, v);
1882#else
1883 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1884 d_ptr->f.Uniform1iv(location, count, v);
1885#endif
1886 Q_OPENGL_FUNCTIONS_DEBUG
1887}
1888
1889inline void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
1890{
1891#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1892 ::glUniform2f(location, x, y);
1893#else
1894 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1895 d_ptr->f.Uniform2f(location, x, y);
1896#endif
1897 Q_OPENGL_FUNCTIONS_DEBUG
1898}
1899
1900inline void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1901{
1902#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1903 ::glUniform2fv(location, count, v);
1904#else
1905 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1906 d_ptr->f.Uniform2fv(location, count, v);
1907#endif
1908 Q_OPENGL_FUNCTIONS_DEBUG
1909}
1910
1911inline void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
1912{
1913#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1914 ::glUniform2i(location, x, y);
1915#else
1916 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1917 d_ptr->f.Uniform2i(location, x, y);
1918#endif
1919 Q_OPENGL_FUNCTIONS_DEBUG
1920}
1921
1922inline void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
1923{
1924#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1925 ::glUniform2iv(location, count, v);
1926#else
1927 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1928 d_ptr->f.Uniform2iv(location, count, v);
1929#endif
1930 Q_OPENGL_FUNCTIONS_DEBUG
1931}
1932
1933inline void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1934{
1935#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1936 ::glUniform3f(location, x, y, z);
1937#else
1938 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1939 d_ptr->f.Uniform3f(location, x, y, z);
1940#endif
1941 Q_OPENGL_FUNCTIONS_DEBUG
1942}
1943
1944inline void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1945{
1946#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1947 ::glUniform3fv(location, count, v);
1948#else
1949 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1950 d_ptr->f.Uniform3fv(location, count, v);
1951#endif
1952 Q_OPENGL_FUNCTIONS_DEBUG
1953}
1954
1955inline void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
1956{
1957#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1958 ::glUniform3i(location, x, y, z);
1959#else
1960 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1961 d_ptr->f.Uniform3i(location, x, y, z);
1962#endif
1963 Q_OPENGL_FUNCTIONS_DEBUG
1964}
1965
1966inline void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
1967{
1968#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1969 ::glUniform3iv(location, count, v);
1970#else
1971 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1972 d_ptr->f.Uniform3iv(location, count, v);
1973#endif
1974 Q_OPENGL_FUNCTIONS_DEBUG
1975}
1976
1977inline void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1978{
1979#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1980 ::glUniform4f(location, x, y, z, w);
1981#else
1982 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1983 d_ptr->f.Uniform4f(location, x, y, z, w);
1984#endif
1985 Q_OPENGL_FUNCTIONS_DEBUG
1986}
1987
1988inline void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1989{
1990#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
1991 ::glUniform4fv(location, count, v);
1992#else
1993 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
1994 d_ptr->f.Uniform4fv(location, count, v);
1995#endif
1996 Q_OPENGL_FUNCTIONS_DEBUG
1997}
1998
1999inline void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
2000{
2001#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2002 ::glUniform4i(location, x, y, z, w);
2003#else
2004 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2005 d_ptr->f.Uniform4i(location, x, y, z, w);
2006#endif
2007 Q_OPENGL_FUNCTIONS_DEBUG
2008}
2009
2010inline void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
2011{
2012#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2013 ::glUniform4iv(location, count, v);
2014#else
2015 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2016 d_ptr->f.Uniform4iv(location, count, v);
2017#endif
2018 Q_OPENGL_FUNCTIONS_DEBUG
2019}
2020
2021inline void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2022{
2023#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2024 ::glUniformMatrix2fv(location, count, transpose, value);
2025#else
2026 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2027 d_ptr->f.UniformMatrix2fv(location, count, transpose, value);
2028#endif
2029 Q_OPENGL_FUNCTIONS_DEBUG
2030}
2031
2032inline void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2033{
2034#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2035 ::glUniformMatrix3fv(location, count, transpose, value);
2036#else
2037 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2038 d_ptr->f.UniformMatrix3fv(location, count, transpose, value);
2039#endif
2040 Q_OPENGL_FUNCTIONS_DEBUG
2041}
2042
2043inline void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2044{
2045#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2046 ::glUniformMatrix4fv(location, count, transpose, value);
2047#else
2048 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2049 d_ptr->f.UniformMatrix4fv(location, count, transpose, value);
2050#endif
2051 Q_OPENGL_FUNCTIONS_DEBUG
2052}
2053
2054inline void QOpenGLFunctions::glUseProgram(GLuint program)
2055{
2056#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2057 ::glUseProgram(program);
2058#else
2059 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2060 d_ptr->f.UseProgram(program);
2061#endif
2062 Q_OPENGL_FUNCTIONS_DEBUG
2063}
2064
2065inline void QOpenGLFunctions::glValidateProgram(GLuint program)
2066{
2067#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2068 ::glValidateProgram(program);
2069#else
2070 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2071 d_ptr->f.ValidateProgram(program);
2072#endif
2073 Q_OPENGL_FUNCTIONS_DEBUG
2074}
2075
2076inline void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
2077{
2078#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2079 ::glVertexAttrib1f(indx, x);
2080#else
2081 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2082 d_ptr->f.VertexAttrib1f(indx, x);
2083#endif
2084 Q_OPENGL_FUNCTIONS_DEBUG
2085}
2086
2087inline void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
2088{
2089#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2090 ::glVertexAttrib1fv(indx, values);
2091#else
2092 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2093 d_ptr->f.VertexAttrib1fv(indx, values);
2094#endif
2095 Q_OPENGL_FUNCTIONS_DEBUG
2096}
2097
2098inline void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
2099{
2100#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2101 ::glVertexAttrib2f(indx, x, y);
2102#else
2103 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2104 d_ptr->f.VertexAttrib2f(indx, x, y);
2105#endif
2106 Q_OPENGL_FUNCTIONS_DEBUG
2107}
2108
2109inline void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
2110{
2111#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2112 ::glVertexAttrib2fv(indx, values);
2113#else
2114 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2115 d_ptr->f.VertexAttrib2fv(indx, values);
2116#endif
2117 Q_OPENGL_FUNCTIONS_DEBUG
2118}
2119
2120inline void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
2121{
2122#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2123 ::glVertexAttrib3f(indx, x, y, z);
2124#else
2125 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2126 d_ptr->f.VertexAttrib3f(indx, x, y, z);
2127#endif
2128 Q_OPENGL_FUNCTIONS_DEBUG
2129}
2130
2131inline void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
2132{
2133#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2134 ::glVertexAttrib3fv(indx, values);
2135#else
2136 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2137 d_ptr->f.VertexAttrib3fv(indx, values);
2138#endif
2139 Q_OPENGL_FUNCTIONS_DEBUG
2140}
2141
2142inline void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2143{
2144#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2145 ::glVertexAttrib4f(indx, x, y, z, w);
2146#else
2147 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2148 d_ptr->f.VertexAttrib4f(indx, x, y, z, w);
2149#endif
2150 Q_OPENGL_FUNCTIONS_DEBUG
2151}
2152
2153inline void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
2154{
2155#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2156 ::glVertexAttrib4fv(indx, values);
2157#else
2158 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2159 d_ptr->f.VertexAttrib4fv(indx, values);
2160#endif
2161 Q_OPENGL_FUNCTIONS_DEBUG
2162}
2163
2164inline void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
2165{
2166#if QT_CONFIG(opengles2) && defined(Q_OS_ANDROID)
2167 ::glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
2168#else
2169 Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
2170 d_ptr->f.VertexAttribPointer(indx, size, type, normalized, stride, ptr);
2171#endif
2172 Q_OPENGL_FUNCTIONS_DEBUG
2173}
2174
2175#undef QT_OPENGL_DECLARE_FUNCTIONS
2176#undef QT_OPENGL_COUNT_FUNCTIONS
2177#undef QT_OPENGL_DECLARE
2178
2179QT_END_NAMESPACE
2180
2181#endif // QT_NO_OPENGL
2182
2183#endif
2184