QtBase
v6.3.1
src
gui
kernel
qopenglcontext.h
Go to the documentation of this file.
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 QOPENGLCONTEXT_H
41
#define QOPENGLCONTEXT_H
42
43
#include <QtGui/qtguiglobal.h>
44
45
#ifndef QT_NO_OPENGL
46
47
#include <QtCore/qnamespace.h>
48
#include <QtCore/QObject>
49
#include <QtCore/QScopedPointer>
50
#include <QtCore/qnativeinterface.h>
51
52
#include <QtGui/QSurfaceFormat>
53
54
#ifdef __GLEW_H__
55
#if defined(Q_CC_GNU)
56
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
57
#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
58
#endif
59
#endif
60
61
#include <QtGui/qopengl.h>
62
63
#include <QtCore/qvariant.h>
64
65
QT_BEGIN_NAMESPACE
66
67
class
QDebug
;
68
class
QOpenGLContextPrivate
;
69
class
QOpenGLContextGroupPrivate
;
70
class
QOpenGLFunctions
;
71
class
QOpenGLExtraFunctions
;
72
class
QPlatformOpenGLContext
;
73
74
class
QScreen
;
75
class
QSurface
;
76
77
class
Q_GUI_EXPORT
QOpenGLContextGroup
:
public
QObject
78
{
79
Q_OBJECT
80
Q_DECLARE_PRIVATE(
QOpenGLContextGroup
)
81
public
:
82
~
QOpenGLContextGroup
();
83
84
QList<QOpenGLContext *>
shares()
const
;
85
86
static
QOpenGLContextGroup
*currentContextGroup();
87
88
private
:
89
QOpenGLContextGroup
();
90
91
friend
class
QOpenGLContext
;
92
friend
class
QOpenGLContextPrivate
;
93
friend
class
QOpenGLContextGroupResourceBase;
94
friend
class
QOpenGLSharedResource
;
95
friend
class
QOpenGLMultiGroupSharedResource
;
96
};
97
98
99
class
QOpenGLTextureHelper
;
100
101
class
Q_GUI_EXPORT
QOpenGLContext
:
public
QObject
102
{
103
Q_OBJECT
104
Q_DECLARE_PRIVATE(
QOpenGLContext
)
105
public
:
106
explicit
QOpenGLContext
(
QObject
*
parent
=
nullptr
);
107
~
QOpenGLContext
();
108
109
void
setFormat
(
const
QSurfaceFormat
&
format
);
110
void
setShareContext(
QOpenGLContext
*shareContext);
111
void
setScreen(
QScreen
*
screen
);
112
113
bool
create
();
114
bool
isValid()
const
;
115
116
QSurfaceFormat
format
()
const
;
117
QOpenGLContext
*shareContext()
const
;
118
QOpenGLContextGroup
*shareGroup()
const
;
119
QScreen
*
screen
()
const
;
120
121
GLuint
defaultFramebufferObject()
const
;
122
123
bool
makeCurrent(
QSurface
*surface);
124
void
doneCurrent();
125
126
void
swapBuffers(
QSurface
*surface);
127
QFunctionPointer
getProcAddress
(
const
QByteArray
&procName)
const
;
128
QFunctionPointer
getProcAddress
(
const
char
*procName)
const
;
129
130
QSurface
*surface()
const
;
131
132
static
QOpenGLContext
*currentContext();
133
static
bool
areSharing(
QOpenGLContext
*
first
,
QOpenGLContext
*second);
134
135
QPlatformOpenGLContext
*
handle
()
const
;
136
QPlatformOpenGLContext
*shareHandle()
const
;
137
138
QOpenGLFunctions
*functions()
const
;
139
QOpenGLExtraFunctions
*extraFunctions()
const
;
140
141
QSet<QByteArray>
extensions()
const
;
142
bool
hasExtension(
const
QByteArray
&extension)
const
;
143
144
enum
OpenGLModuleType
{
145
LibGL
,
146
LibGLES
147
};
148
149
static
OpenGLModuleType openGLModuleType();
150
151
bool
isOpenGLES()
const
;
152
153
static
bool
supportsThreadedOpenGL();
154
static
QOpenGLContext
*globalShareContext();
155
156
QT_DECLARE_NATIVE_INTERFACE_ACCESSOR
(
QOpenGLContext
)
157
158
Q_SIGNALS
:
159
void
aboutToBeDestroyed
();
160
161
private
:
162
friend
class
QOpenGLContextResourceBase;
163
friend
class
QOpenGLPaintDevice
;
164
friend
class
QOpenGLGlyphTexture
;
165
friend
class
QOpenGLTextureGlyphCache
;
166
friend
class
QOpenGLEngineShaderManager
;
167
friend
class
QOpenGLFramebufferObject
;
168
friend
class
QOpenGLFramebufferObjectPrivate
;
169
friend
class
QOpenGL2PaintEngineEx
;
170
friend
class
QOpenGL2PaintEngineExPrivate
;
171
friend
class
QSGDistanceFieldGlyphCache;
172
friend
class
QWidgetPrivate
;
173
friend
class
QAbstractOpenGLFunctionsPrivate
;
174
friend
class
QOpenGLTexturePrivate
;
175
176
QOpenGLTextureHelper
* textureFunctions()
const
;
177
void
setTextureFunctions(
QOpenGLTextureHelper
* textureFuncs,
std::function
<
void
()> destroyCallback);
178
179
void
destroy
();
180
181
Q_PRIVATE_SLOT
(d_func(),
void
_q_screenDestroyed(
QObject
*
object
))
182
};
183
184
#ifndef QT_NO_DEBUG_STREAM
185
Q_GUI_EXPORT
QDebug
operator<<
(
QDebug
debug
,
const
QOpenGLContext
*ctx);
186
Q_GUI_EXPORT
QDebug
operator<<
(
QDebug
debug
,
const
QOpenGLContextGroup
*cg);
187
#endif
// !QT_NO_DEBUG_STREAM
188
189
QT_END_NAMESPACE
190
191
#include <QtGui/qopenglcontext_platform.h>
192
193
#endif
// QT_NO_OPENGL
194
195
#endif
// QOPENGLCONTEXT_H
QAbstractOpenGLFunctionsPrivate
Definition:
qopenglversionfunctions.h:192
QByteArray
The QByteArray class provides an array of bytes.
Definition:
qbytearray.h:85
QDataStream::operator<<
operator<<(QDataStream &ds, qfloat16 f)
Definition:
qfloat16.cpp:327
QDebug
The QDebug class provides an output stream for debugging information.
Definition:
qdebug.h:65
QList< QOpenGLContext * >
QObject
The QObject class is the base class of all Qt objects.
Definition:
qobject.h:125
QOpenGL2PaintEngineEx
Definition:
qopenglpaintengine_p.h:112
QOpenGL2PaintEngineExPrivate
Definition:
qopenglpaintengine_p.h:178
QOpenGLContextGroup
The QOpenGLContextGroup class represents a group of contexts sharing OpenGL resources....
Definition:
qopenglcontext.h:78
QOpenGLContextGroupPrivate
Definition:
qopenglcontext_p.h:130
QOpenGLContext
The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.
Definition:
qopenglcontext.h:102
QOpenGLContext::OpenGLModuleType
OpenGLModuleType
Definition:
qopenglcontext.h:144
QOpenGLContext::LibGL
@ LibGL
Definition:
qopenglcontext.h:145
QOpenGLContext::aboutToBeDestroyed
void aboutToBeDestroyed()
QOpenGLContextPrivate
Definition:
qopenglcontext_p.h:203
QOpenGLEngineShaderManager
Definition:
qopenglengineshadermanager_p.h:409
QOpenGLExtraFunctions
The QOpenGLExtraFunctions class provides cross-platform access to the OpenGL ES 3....
Definition:
qopenglextrafunctions.h:283
QOpenGLFramebufferObject
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer object.
Definition:
qopenglframebufferobject.h:67
QOpenGLFramebufferObjectPrivate
Definition:
qopenglframebufferobject_p.h:109
QOpenGLFunctions
The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API.
Definition:
qopenglfunctions.h:238
QOpenGLGlyphTexture
Definition:
qopengltextureglyphcache_p.h:69
QOpenGLMultiGroupSharedResource
Definition:
qopenglcontext_p.h:159
QOpenGLPaintDevice
The QOpenGLPaintDevice class enables painting to an OpenGL context using QPainter.
Definition:
qopenglpaintdevice.h:56
QOpenGLSharedResource
Definition:
qopenglcontext_p.h:76
QOpenGLTextureGlyphCache
Definition:
qopengltextureglyphcache_p.h:111
QOpenGLTextureHelper
Definition:
qopengltexturehelper_p.h:90
QOpenGLTexturePrivate
Definition:
qopengltexture_p.h:77
QPlatformOpenGLContext
Definition:
qplatformopenglcontext.h:70
QScreen
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition:
qscreen.h:68
QSet< QByteArray >
QSurfaceFormat
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
Definition:
qsurfaceformat.h:53
QSurface
The QSurface class is an abstraction of renderable surfaces in Qt.
Definition:
qsurface.h:57
QWidgetPrivate
Definition:
qwidget_p.h:220
setFormat
widget setFormat(format)
QT_BEGIN_NAMESPACE
Definition:
server.cpp:57
QT_END_NAMESPACE
Definition:
qsharedpointer.cpp:1532
function
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
Definition:
qdbus_symbols_p.h:206
debug
@ debug
Definition:
qibusplatforminputcontext.cpp:79
QT_DECLARE_NATIVE_INTERFACE_ACCESSOR
#define QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(T)
Definition:
qnativeinterface.h:169
handle
GLuint64 GLenum void * handle
Definition:
qopengles2ext.h:1575
first
GLint first
Definition:
qopengles2ext.h:913
GLuint
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
format
GLint GLsizei GLsizei GLenum format
Definition:
qopengles2ext.h:206
getProcAddress
const void * getProcAddress
Definition:
qopenglext.h:11305
Q_OBJECT
#define Q_OBJECT
Definition:
qtmetamacros.h:158
Q_PRIVATE_SLOT
#define Q_PRIVATE_SLOT(d, signature)
Definition:
qtmetamacros.h:82
Q_SIGNALS
#define Q_SIGNALS
Definition:
qtmetamacros.h:81
destroy
HB_EXTERN hb_font_get_glyph_func_t void hb_destroy_func_t destroy
Definition:
hb-deprecated.h:108
screen
QScreen * screen
[1]
Definition:
main.cpp:76
create
view create()
parent
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
Definition:
uiaclientinterfaces_p.h:245
Generated by
1.9.1