Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmultimedia_gl_support_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
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 QMULTIMEDIA_GL_SUPPORT_P_H
5#define QMULTIMEDIA_GL_SUPPORT_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 <QtMultimedia/private/qtmultimediaglobal_p.h>
19#include <QtGui/qopengl.h>
20#include <QtCore/private/quniquehandle_p.h>
21#include <QtCore/qstring.h>
22
23// thanks X.h
24#pragma push_macro("Success")
25#ifdef Success
26# undef Success
27#endif
28
29#pragma push_macro("BadAccess")
30#ifdef BadAccess
31# undef BadAccess
32#endif
33
34#pragma push_macro("BadAlloc")
35#ifdef BadAlloc
36# undef BadAlloc
37#endif
38
39#pragma push_macro("BadMatch")
40#ifdef BadMatch
41# undef BadMatch
42#endif
43
44#if QT_CONFIG(egl)
45typedef void *EGLDisplay;
46typedef void *EGLImage;
47#endif
48
49QT_BEGIN_NAMESPACE
50
51class QOpenGLContext;
52class QDebug;
53class QRhi;
54
55namespace QtMultimediaPrivate {
56
57// Error codes returned by glGetError(), see
58// https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetError.xhtml
59enum class GLError : unsigned int {
61 InvalidEnum = 0x0500,
62 InvalidValue = 0x0501,
64 StackOverflow = 0x0503,
66 OutOfMemory = 0x0505,
68};
69
70Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug debug, GLError error);
71
72#if QT_CONFIG(egl)
73
74// Error codes returned by eglGetError(), see
75// https://registry.khronos.org/EGL/sdk/docs/man/html/eglGetError.xhtml
76enum class EGLError : int {
77 Success = 0x3000,
78 NotInitialized = 0x3001,
79 BadAccess = 0x3002,
80 BadAlloc = 0x3003,
81 BadAttribute = 0x3004,
82 BadConfig = 0x3005,
83 BadContext = 0x3006,
84 BadCurrentSurface = 0x3007,
85 BadDisplay = 0x3008,
86 BadMatch = 0x3009,
87 BadNativePixmap = 0x300A,
88 BadNativeWindow = 0x300B,
89 BadParameter = 0x300C,
90 BadSurface = 0x300D,
91 ContextLost = 0x300E,
92};
93
95
97
98///////////////////////////////////////////////////////////////////////////////
99// (e)gl handle types
100
102{
103public:
104 EglImageDeleter() = default;
106 void operator()(EGLImage image) const noexcept;
107
108private:
109 EGLDisplay m_display = {}; // EGL_NO_DISPLAY;
110};
111
113{
114 using Type = EGLImage;
115 static Type invalidValue() { return nullptr; } // EGL_NO_IMAGE;
116};
118
119#endif // QT_CONFIG(egl)
120
121class Q_MULTIMEDIA_EXPORT GlTextureDeleter
122{
123public:
124 GlTextureDeleter() = default;
126 void operator()(GLuint texture) const noexcept;
127
128private:
129 QOpenGLContext *m_context = nullptr;
130};
131
133{
134 using Type = GLuint;
135 static Type invalidValue() { return 0; }
136};
138
139} // namespace QtMultimediaPrivate
140
141QT_END_NAMESPACE
142
143#pragma pop_macro("Success")
144#pragma pop_macro("BadAccess")
145#pragma pop_macro("BadAlloc")
146#pragma pop_macro("BadMatch")
147
148#endif
Combined button and popup list for selecting options.
static QString toString(GLError error)