Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopengltexturehelper_p.h
Go to the documentation of this file.
1// Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPENGLTEXTUREHELPER_P_H
5#define QOPENGLTEXTUREHELPER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtOpenGL/qtopenglglobal.h>
19#include <QtCore/private/qglobal_p.h>
20
21#ifndef QT_NO_OPENGL
22
23#include "qopengl.h"
25#include "qopengltexture.h"
26#include "qopenglfunctions.h"
27
29
30// Constants for OpenGL and OpenGL ES 3.0+ which are not available with OpenGL ES 2.0.
31#ifndef GL_TEXTURE_BASE_LEVEL
32#define GL_TEXTURE_BASE_LEVEL 0x813C
33#endif
34#ifndef GL_TEXTURE_MAX_LEVEL
35#define GL_TEXTURE_MAX_LEVEL 0x813D
36#endif
37#ifndef GL_TEXTURE_COMPARE_MODE
38#define GL_TEXTURE_COMPARE_MODE 0x884C
39#endif
40#ifndef GL_TEXTURE_COMPARE_FUNC
41#define GL_TEXTURE_COMPARE_FUNC 0x884D
42#endif
43
44// use GL_APICALL only on Android + __clang__
45#if !defined(Q_OS_ANDROID) || !defined(__clang__)
46# undef GL_APICALL
47# define GL_APICALL
48#elif !defined(GL_APICALL)
49# define GL_APICALL
50#endif
51
52class QOpenGLContext;
53
55{
56public:
58
59 // DSA-like API. Will either use real DSA or our emulation
61 {
62 (this->*TextureParameteri)(texture, target, bindingTarget, pname, param);
63 }
64
66 {
67 (this->*TextureParameteriv)(texture, target, bindingTarget, pname, params);
68 }
69
71 {
72 (this->*TextureParameterf)(texture, target, bindingTarget, pname, param);
73 }
74
76 {
77 (this->*TextureParameterfv)(texture, target, bindingTarget, pname, params);
78 }
79
81 {
82 (this->*GenerateTextureMipmap)(texture, target, bindingTarget);
83 }
84
87 {
88 (this->*TextureStorage3D)(texture, target, bindingTarget, levels, internalFormat, width, height, depth);
89 }
90
93 {
94 (this->*TextureStorage2D)(texture, target, bindingTarget, levels, internalFormat, width, height);
95 }
96
99 {
100 (this->*TextureStorage1D)(texture, target, bindingTarget, levels, internalFormat, width);
101 }
102
108
114
117 {
118 (this->*TextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, format, type, pixels);
119 }
120
123 {
124 (this->*TextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, format, type, pixels);
125 }
126
129 {
130 (this->*TextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, format, type, pixels);
131 }
132
135 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
136 {
137 if (options) {
139 setPixelUploadOptions(*options);
140 (this->*TextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
141 setPixelUploadOptions(oldOptions);
142 } else {
143 (this->*TextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
144 }
145 }
146
149 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
150 {
151 if (options) {
153 setPixelUploadOptions(*options);
154 (this->*TextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, type, pixels);
155 setPixelUploadOptions(oldOptions);
156 } else {
157 (this->*TextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, type, pixels);
158 }
159 }
160
163 const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
164 {
165 if (options) {
167 setPixelUploadOptions(*options);
168 (this->*TextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, type, pixels);
169 setPixelUploadOptions(oldOptions);
170 } else {
171 (this->*TextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, type, pixels);
172 }
173 }
174
180
186
189 GLenum format, GLsizei imageSize, const GLvoid *bits,
190 const QOpenGLPixelTransferOptions * const options = nullptr)
191 {
192 if (options) {
194 setPixelUploadOptions(*options);
195 (this->*CompressedTextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, imageSize, bits);
196 setPixelUploadOptions(oldOptions);
197 } else {
198 (this->*CompressedTextureSubImage1D)(texture, target, bindingTarget, level, xoffset, width, format, imageSize, bits);
199 }
200 }
201
205 GLenum format, GLsizei imageSize, const GLvoid *bits,
206 const QOpenGLPixelTransferOptions * const options = nullptr)
207 {
208 if (options) {
210 setPixelUploadOptions(*options);
211 (this->*CompressedTextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, imageSize, bits);
212 setPixelUploadOptions(oldOptions);
213 } else {
214 (this->*CompressedTextureSubImage2D)(texture, target, bindingTarget, level, xoffset, yoffset, width, height, format, imageSize, bits);
215 }
216 }
217
221 GLenum format, GLsizei imageSize, const GLvoid *bits,
222 const QOpenGLPixelTransferOptions * const options = nullptr)
223 {
224 if (options) {
226 setPixelUploadOptions(*options);
227 (this->*CompressedTextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
228 setPixelUploadOptions(oldOptions);
229 } else {
230 (this->*CompressedTextureSubImage3D)(texture, target, bindingTarget, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
231 }
232 }
233
236 GLint border, GLsizei imageSize, const GLvoid *bits,
237 const QOpenGLPixelTransferOptions * const options = nullptr)
238 {
239 if (options) {
241 setPixelUploadOptions(*options);
242 (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
243 setPixelUploadOptions(oldOptions);
244 } else {
245 (this->*CompressedTextureImage1D)(texture, target, bindingTarget, level, internalFormat, width, border, imageSize, bits);
246 }
247 }
248
251 GLint border, GLsizei imageSize, const GLvoid *bits,
252 const QOpenGLPixelTransferOptions * const options = nullptr)
253
254 {
255 if (options) {
257 setPixelUploadOptions(*options);
258 (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
259 setPixelUploadOptions(oldOptions);
260 } else {
261 (this->*CompressedTextureImage2D)(texture, target, bindingTarget, level, internalFormat, width, height, border, imageSize, bits);
262 }
263 }
264
267 GLint border, GLsizei imageSize, const GLvoid *bits,
268 const QOpenGLPixelTransferOptions * const options = nullptr)
269 {
270 if (options) {
272 setPixelUploadOptions(*options);
273 (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
274 setPixelUploadOptions(oldOptions);
275 } else {
276 (this->*CompressedTextureImage3D)(texture, target, bindingTarget, level, internalFormat, width, height, depth, border, imageSize, bits);
277 }
278 }
279
280private:
281 // DSA wrapper (so we can use pointer to member function as switch)
282 void dsa_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
283
284 void dsa_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
285
286 void dsa_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
287
288 void dsa_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
289
290 void dsa_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget);
291
292 void dsa_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
294
295 void dsa_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
297
298 void dsa_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat,
299 GLsizei width);
300
301 void dsa_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
303
304 void dsa_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat,
306
307 void dsa_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
309
310 void dsa_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
312
313 void dsa_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
315
316 void dsa_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
318
319 void dsa_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset,
321
322 void dsa_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset,
323 GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
324
325 void dsa_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
327
328 void dsa_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat,
330
331 void dsa_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
333 GLenum format, GLsizei imageSize, const GLvoid *bits);
334
335 void dsa_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
338 GLenum format, GLsizei imageSize, const GLvoid *bits);
339
340 void dsa_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
343 GLenum format, GLsizei imageSize, const GLvoid *bits);
344
345 void dsa_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
347 GLint border, GLsizei imageSize, const GLvoid *bits);
348
349 void dsa_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
351 GLint border, GLsizei imageSize, const GLvoid *bits);
352
353 void dsa_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
355 GLint border, GLsizei imageSize, const GLvoid *bits);
356
357 // DSA emulation API
358 void qt_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
359
360 void qt_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
361
362 void qt_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
363
364 void qt_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
365
366 void qt_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget);
367
368 void qt_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
370
371 void qt_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
373
374 void qt_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels,
376
377 void qt_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
380
381 void qt_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
384
385 void qt_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
388 const GLvoid *pixels);
389
390 void qt_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
393 const GLvoid *pixels);
394
395 void qt_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
397 const GLvoid *pixels);
398
399 void qt_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
402 GLenum format, GLenum type, const GLvoid *pixels);
403
404 void qt_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
407 GLenum format, GLenum type, const GLvoid *pixels);
408
409 void qt_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
411 GLenum format, GLenum type, const GLvoid *pixels);
412
413 void qt_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
416
417 void qt_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples,
420
421 void qt_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
423 GLsizei imageSize, const GLvoid *bits);
424
425 void qt_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
428 GLenum format, GLsizei imageSize, const GLvoid *bits);
429
430 void qt_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
433 GLenum format, GLsizei imageSize, const GLvoid *bits);
434
435 void qt_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
437 GLsizei imageSize, const GLvoid *bits);
438
439 void qt_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
441 GLsizei imageSize, const GLvoid *bits);
442
443 void qt_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat,
445 GLsizei imageSize, const GLvoid *bits);
446
447public:
448 // Raw OpenGL functions, resolved and used by our DSA-like static functions if no EXT_direct_state_access is available
449
450 // OpenGL 1.0
457
458 // OpenGL 1.1
460 GLenum format, GLenum type, const GLvoid *pixels)
461 {
462 TexSubImage1D(target, level, xoffset, width, format, type, pixels);
463 }
464
465 // OpenGL 1.2
472
478
479 // OpenGL 1.3
481 {
482 GetCompressedTexImage(target, level, img);
483 }
484
486 GLenum format, GLsizei imageSize, const GLvoid *data)
487 {
488 CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data);
489 }
490
496
502
508
514
521
523 {
524 ActiveTexture(texture);
525 }
526
527 // OpenGL 3.0
529 {
530 GenerateMipmap(target);
531 }
532
533 // OpenGL 3.2
540
547
548 // OpenGL 4.2
553
558
563
564 // OpenGL 4.3
570
576
582
584 GLuint minLevel, GLuint numLevels, GLuint minLayer, GLuint numLayers)
585 {
586 TextureView(texture, target, origTexture, internalFormat, minLevel, numLevels, minLayer, numLayers);
587 }
588
589 // Helper functions
591 {
593 int val = 0;
594 functions->glGetIntegerv(GL_UNPACK_ALIGNMENT, &val);
595 options.setAlignment(val);
596#if !QT_CONFIG(opengles2)
598 options.setSkipImages(val);
599 functions->glGetIntegerv(GL_UNPACK_SKIP_ROWS, &val);
600 options.setSkipRows(val);
601 functions->glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &val);
602 options.setSkipPixels(val);
604 options.setImageHeight(val);
606 options.setRowLength(val);
607 GLboolean b = GL_FALSE;
608 functions->glGetBooleanv(GL_UNPACK_LSB_FIRST, &b);
610 functions->glGetBooleanv(GL_UNPACK_SWAP_BYTES, &b);
611 options.setSwapBytesEnabled(b);
612#endif
613 return options;
614 }
615
617 {
618 functions->glPixelStorei(GL_UNPACK_ALIGNMENT, options.alignment());
619#if !QT_CONFIG(opengles2)
621 functions->glPixelStorei(GL_UNPACK_SKIP_ROWS, options.skipRows());
622 functions->glPixelStorei(GL_UNPACK_SKIP_PIXELS, options.skipPixels());
625 functions->glPixelStorei(GL_UNPACK_LSB_FIRST, options.isLeastSignificantBitFirst());
626 functions->glPixelStorei(GL_UNPACK_SWAP_BYTES, options.isSwapBytesEnabled());
627#endif
628 }
629
631private:
632 // Typedefs and pointers to member functions used to switch between EXT_direct_state_access and our own emulated DSA.
633 // The argument match the corresponding GL function, but there's an extra "GLenum bindingTarget" which gets used with
634 // the DSA emulation -- it contains the right GL_BINDING_TEXTURE_X to use.
635 typedef void (QOpenGLTextureHelper::*TextureParameteriMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param);
636 typedef void (QOpenGLTextureHelper::*TextureParameterivMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params);
637 typedef void (QOpenGLTextureHelper::*TextureParameterfMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param);
638 typedef void (QOpenGLTextureHelper::*TextureParameterfvMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params);
639 typedef void (QOpenGLTextureHelper::*GenerateTextureMipmapMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget);
641 typedef void (QOpenGLTextureHelper::*TextureStorage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height);
642 typedef void (QOpenGLTextureHelper::*TextureStorage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width);
646 typedef void (QOpenGLTextureHelper::*TextureImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
647 typedef void (QOpenGLTextureHelper::*TextureImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
648 typedef void (QOpenGLTextureHelper::*TextureSubImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
649 typedef void (QOpenGLTextureHelper::*TextureSubImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
650 typedef void (QOpenGLTextureHelper::*TextureSubImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
653 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
654 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
655 typedef void (QOpenGLTextureHelper::*CompressedTextureSubImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
656 typedef void (QOpenGLTextureHelper::*CompressedTextureImage1DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
657 typedef void (QOpenGLTextureHelper::*CompressedTextureImage2DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
658 typedef void (QOpenGLTextureHelper::*CompressedTextureImage3DMemberFunc)(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
659
660
661 TextureParameteriMemberFunc TextureParameteri;
662 TextureParameterivMemberFunc TextureParameteriv;
663 TextureParameterfMemberFunc TextureParameterf;
664 TextureParameterfvMemberFunc TextureParameterfv;
665 GenerateTextureMipmapMemberFunc GenerateTextureMipmap;
666 TextureStorage3DMemberFunc TextureStorage3D;
667 TextureStorage2DMemberFunc TextureStorage2D;
668 TextureStorage1DMemberFunc TextureStorage1D;
669 TextureStorage3DMultisampleMemberFunc TextureStorage3DMultisample;
670 TextureStorage2DMultisampleMemberFunc TextureStorage2DMultisample;
671 TextureImage3DMemberFunc TextureImage3D;
672 TextureImage2DMemberFunc TextureImage2D;
673 TextureImage1DMemberFunc TextureImage1D;
674 TextureSubImage3DMemberFunc TextureSubImage3D;
675 TextureSubImage2DMemberFunc TextureSubImage2D;
676 TextureSubImage1DMemberFunc TextureSubImage1D;
677 TextureImage3DMultisampleMemberFunc TextureImage3DMultisample;
678 TextureImage2DMultisampleMemberFunc TextureImage2DMultisample;
679 CompressedTextureSubImage1DMemberFunc CompressedTextureSubImage1D;
680 CompressedTextureSubImage2DMemberFunc CompressedTextureSubImage2D;
681 CompressedTextureSubImage3DMemberFunc CompressedTextureSubImage3D;
682 CompressedTextureImage1DMemberFunc CompressedTextureImage1D;
683 CompressedTextureImage2DMemberFunc CompressedTextureImage2D;
684 CompressedTextureImage3DMemberFunc CompressedTextureImage3D;
685
686 // Raw function pointers for core and DSA functions
687
688 // EXT_direct_state_access used when DSA is available
690 void (QOPENGLF_APIENTRYP TextureParameterivEXT)(GLuint texture, GLenum target, GLenum pname, const GLint *params);
692 void (QOPENGLF_APIENTRYP TextureParameterfvEXT)(GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
693 void (QOPENGLF_APIENTRYP GenerateTextureMipmapEXT)(GLuint texture, GLenum target);
705 void (QOPENGLF_APIENTRYP CompressedTextureSubImage1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
711
712
713 // Plus some missing ones that are in the NV_texture_multisample extension instead
716
717 // OpenGL 1.0
719
720 // OpenGL 1.1
722
723 // OpenGL 1.2
726
727 // OpenGL 1.3
728 void (QOPENGLF_APIENTRYP GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img);
729 void (QOPENGLF_APIENTRYP CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
736
737 // OpenGL 3.0
739
740 // OpenGL 3.2
743
744 // OpenGL 4.2
748
749 // OpenGL 4.3
754};
755
757
758#undef Q_CALL_MEMBER_FUNCTION
759
760#endif // QT_NO_OPENGL
761
762#endif // QOPENGLTEXTUREHELPER_P_H
\inmodule QtGui
The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API.
void glPixelStorei(GLenum pname, GLint param)
Convenience function that calls glPixelStorei(pname, param).
void glGetBooleanv(GLenum pname, GLboolean *params)
Convenience function that calls glGetBooleanv(pname, params).
void glGetIntegerv(GLenum pname, GLint *params)
Convenience function that calls glGetIntegerv(pname, params).
void setSkipPixels(int skipPixels)
Sets the number of pixels that are skipped to skipPixels.
void setRowLength(int rowLength)
Sets the number of pixels in a row to rowLength.
void setImageHeight(int imageHeight)
Sets the image height for 3D textures to imageHeight.
void setSwapBytesEnabled(bool swapBytes)
swapBytes specifies if the byte ordering for multibyte components is reversed.
void setSkipRows(int skipRows)
Sets the number of rows that are skipped to skipRows.
void setLeastSignificantByteFirst(bool lsbFirst)
lsbFirst specifies if bits within a byte are ordered from least to most significat.
void setAlignment(int alignment)
Sets the alignment requirements for each pixel row.
void setSkipImages(int skipImages)
Sets the number of images that are skipped to skipImages.
void glTextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
void glTextureView(GLuint texture, GLenum target, GLuint origTexture, GLenum internalFormat, GLuint minLevel, GLuint numLevels, GLuint minLayer, GLuint numLayers)
void glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
void glTexStorage1D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
void glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
void glCompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
void setPixelUploadOptions(const QOpenGLPixelTransferOptions &options)
void glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
void glTextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
void glTextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
void glActiveTexture(GLenum texture)
void glTextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params)
void glTextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width)
void glTextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params)
QOpenGLPixelTransferOptions savePixelUploadOptions()
void glTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void glTextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
void glTexImage3DMultisample(GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
void glTexImage2DMultisample(GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
void glGetCompressedTexImage(GLenum target, GLint level, GLvoid *img)
void glGenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget)
void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void glTextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
void glGenerateMipmap(GLenum target)
void glTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
void glCompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
void glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param)
void glCompressedTexImage1D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
void glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void glTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels, const QOpenGLPixelTransferOptions *const options=nullptr)
void glCompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
void glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits, const QOpenGLPixelTransferOptions *const options=nullptr)
QOpenGLTextureHelper(QOpenGLContext *context)
void glTextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param)
void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
void glTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels, const QOpenGLPixelTransferOptions *const options=nullptr)
void glTexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size)
Combined button and popup list for selecting options.
static void * context
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
ptrdiff_t GLintptr
Definition qopengl.h:163
#define QOPENGLF_APIENTRYP
Definition qopengl.h:275
ptrdiff_t GLsizeiptr
Definition qopengl.h:164
GLenum GLuint GLenum GLuint GLuint GLuint GLuint numlayers
GLboolean GLboolean GLboolean b
typedef GLint(GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC)(GLuint program
GLint GLenum GLsizei GLsizei GLsizei depth
typedef GLfloat(GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path
GLsizei samples
GLenum GLuint GLint level
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint origtexture
GLenum GLuint GLenum GLuint GLuint GLuint minlayer
GLsizei GLenum GLsizei GLsizei GLboolean fixedSampleLocations
GLuint numLayers
GLenum pname
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLsizei levels
GLenum GLuint buffer
GLint GLint GLint yoffset
GLint GLsizei width
GLint GLint GLint GLint zoffset
typedef GLsizei(GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC)(GLuint target)
GLenum type
GLenum GLuint GLenum GLuint GLuint numlevels
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLenum target
GLenum GLuint texture
GLint GLenum internalformat
GLenum GLuint GLenum GLuint minlevel
GLint GLint xoffset
typedef GLboolean(GL_APIENTRYP PFNGLISENABLEDIOESPROC)(GLenum target
GLenum const GLint * param
GLenum GLuint GLintptr offset
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const void * pixels
GLint GLsizei GLsizei GLenum format
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLsizei GLenum internalFormat
void ** params
GLuint GLfloat * val
GLint void * img
Definition qopenglext.h:233
#define GL_UNPACK_SKIP_IMAGES
Definition qopenglext.h:82
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
#define GL_UNPACK_IMAGE_HEIGHT
Definition qopenglext.h:83
#define GL_APICALL
#define GL_UNPACK_ROW_LENGTH
#define GLuint