Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsurfaceformat.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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
// Qt-Security score:significant reason:default
4
#
ifndef
QSURFACEFORMAT_H
5
#
define
QSURFACEFORMAT_H
6
7
#
include
<
QtGui
/
qtguiglobal
.
h
>
8
#
include
<
QtCore
/
qobjectdefs
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
class
QColorSpace;
13
class
QOpenGLContext;
14
class
QSurfaceFormatPrivate
;
15
16
class
Q_GUI_EXPORT
QSurfaceFormat
17
{
18
Q_GADGET
19
public
:
20
enum
FormatOption {
21
StereoBuffers = 0x0001,
22
DebugContext = 0x0002,
23
DeprecatedFunctions = 0x0004,
24
ResetNotification = 0x0008,
25
ProtectedContent = 0x0010
26
};
27
Q_ENUM(FormatOption)
28
Q_DECLARE_FLAGS(FormatOptions, FormatOption)
29
30
enum
SwapBehavior {
31
DefaultSwapBehavior,
32
SingleBuffer,
33
DoubleBuffer,
34
TripleBuffer
35
};
36
Q_ENUM(SwapBehavior)
37
38
enum
RenderableType {
39
DefaultRenderableType = 0x0,
40
OpenGL = 0x1,
41
OpenGLES = 0x2,
42
OpenVG = 0x4
43
};
44
Q_ENUM(RenderableType)
45
46
enum
OpenGLContextProfile {
47
NoProfile,
48
CoreProfile,
49
CompatibilityProfile
50
};
51
Q_ENUM(OpenGLContextProfile)
52
53
#
if
QT_DEPRECATED_SINCE
(
6
,
0
)
54
enum
ColorSpace {
55
DefaultColorSpace,
56
sRGBColorSpace
57
};
58
Q_ENUM(ColorSpace)
59
#
endif
60
61
QSurfaceFormat();
62
Q_IMPLICIT QSurfaceFormat(FormatOptions options);
63
QSurfaceFormat(
const
QSurfaceFormat &other);
64
QSurfaceFormat &operator=(
const
QSurfaceFormat &other);
65
~QSurfaceFormat();
66
67
void
setDepthBufferSize(
int
size);
68
int
depthBufferSize()
const
;
69
70
void
setStencilBufferSize(
int
size);
71
int
stencilBufferSize()
const
;
72
73
void
setRedBufferSize(
int
size);
74
int
redBufferSize()
const
;
75
void
setGreenBufferSize(
int
size);
76
int
greenBufferSize()
const
;
77
void
setBlueBufferSize(
int
size);
78
int
blueBufferSize()
const
;
79
void
setAlphaBufferSize(
int
size);
80
int
alphaBufferSize()
const
;
81
82
void
setSamples(
int
numSamples);
83
int
samples()
const
;
84
85
void
setSwapBehavior(SwapBehavior behavior);
86
SwapBehavior swapBehavior()
const
;
87
88
bool
hasAlpha()
const
;
89
90
void
setProfile(OpenGLContextProfile profile);
91
OpenGLContextProfile profile()
const
;
92
93
void
setRenderableType(RenderableType type);
94
RenderableType renderableType()
const
;
95
96
void
setMajorVersion(
int
majorVersion);
97
int
majorVersion()
const
;
98
99
void
setMinorVersion(
int
minorVersion);
100
int
minorVersion()
const
;
101
102
std::pair<
int
,
int
> version()
const
;
103
void
setVersion(
int
major,
int
minor);
104
105
bool
stereo()
const
;
106
void
setStereo(
bool
enable);
107
108
void
setOptions(QSurfaceFormat::FormatOptions options);
109
void
setOption(FormatOption option,
bool
on =
true
);
110
bool
testOption(FormatOption option)
const
;
111
QSurfaceFormat::FormatOptions options()
const
;
112
113
int
swapInterval()
const
;
114
void
setSwapInterval(
int
interval);
115
116
const
QColorSpace &colorSpace()
const
;
117
void
setColorSpace(
const
QColorSpace &colorSpace);
118
#
if
QT_DEPRECATED_SINCE
(
6
,
0
)
119
Q_DECL_DEPRECATED_X(
"Use setColorSpace(QColorSpace) instead."
)
120
void
setColorSpace(ColorSpace colorSpace);
121
#
endif
122
123
static
void
setDefaultFormat(
const
QSurfaceFormat &format);
124
static
QSurfaceFormat defaultFormat();
125
126
private
:
127
QSurfaceFormatPrivate *d;
128
129
void
detach();
130
bool
equals(
const
QSurfaceFormat &other)
const
noexcept
;
131
132
friend
inline
bool
operator==(
const
QSurfaceFormat &lhs,
const
QSurfaceFormat &rhs)
noexcept
133
{
return
lhs.equals(rhs); }
134
friend
inline
bool
operator!=(
const
QSurfaceFormat &lhs,
const
QSurfaceFormat &rhs)
noexcept
135
{
return
!lhs.equals(rhs); }
136
#
ifndef
QT_NO_DEBUG_STREAM
137
friend
Q_GUI_EXPORT QDebug operator<<(QDebug,
const
QSurfaceFormat &);
138
#
endif
139
};
140
141
#
ifndef
QT_NO_DEBUG_STREAM
142
Q_GUI_EXPORT
QDebug
operator<<(QDebug,
const
QSurfaceFormat &);
143
#
endif
144
145
Q_DECLARE_OPERATORS_FOR_FLAGS(QSurfaceFormat::FormatOptions)
146
147
inline
bool
QSurfaceFormat::stereo()
const
148
{
149
return
testOption(QSurfaceFormat::StereoBuffers);
150
}
151
152
QT_END_NAMESPACE
153
154
#
endif
//QSURFACEFORMAT_H
QSurfaceFormatPrivate
Definition
qsurfaceformat.cpp:28
QSurfaceFormatPrivate::ref
QAtomicInt ref
Definition
qsurfaceformat.cpp:69
QSurfaceFormatPrivate::swapInterval
int swapInterval
Definition
qsurfaceformat.cpp:83
QSurfaceFormatPrivate::QSurfaceFormatPrivate
QSurfaceFormatPrivate(QSurfaceFormat::FormatOptions _opts={ })
Definition
qsurfaceformat.cpp:30
QSurfaceFormatPrivate::QSurfaceFormatPrivate
QSurfaceFormatPrivate(const QSurfaceFormatPrivate *other)
Definition
qsurfaceformat.cpp:49
QSurfaceFormatPrivate::stencilSize
int stencilSize
Definition
qsurfaceformat.cpp:76
QSurfaceFormatPrivate::blueBufferSize
int blueBufferSize
Definition
qsurfaceformat.cpp:73
QSurfaceFormatPrivate::alphaBufferSize
int alphaBufferSize
Definition
qsurfaceformat.cpp:74
QSurfaceFormatPrivate::colorSpace
QColorSpace colorSpace
Definition
qsurfaceformat.cpp:84
QSurfaceFormatPrivate::major
int major
Definition
qsurfaceformat.cpp:81
QSurfaceFormatPrivate::depthSize
int depthSize
Definition
qsurfaceformat.cpp:75
QSurfaceFormatPrivate::numSamples
int numSamples
Definition
qsurfaceformat.cpp:78
QSurfaceFormatPrivate::greenBufferSize
int greenBufferSize
Definition
qsurfaceformat.cpp:72
QSurfaceFormatPrivate::redBufferSize
int redBufferSize
Definition
qsurfaceformat.cpp:71
QSurfaceFormatPrivate::minor
int minor
Definition
qsurfaceformat.cpp:82
QSurfaceFormat
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
Definition
qsurfaceformat.h:17
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
Q_GLOBAL_STATIC
Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames, { { Qt::DisplayRole, "display" }, { Qt::DecorationRole, "decoration" }, { Qt::EditRole, "edit" }, { Qt::ToolTipRole, "toolTip" }, { Qt::StatusTipRole, "statusTip" }, { Qt::WhatsThisRole, "whatsThis" }, }) const QHash< int
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
operator<<
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
Definition
qfileinfo.cpp:1830
qtbase
src
gui
kernel
qsurfaceformat.h
Generated on
for Qt by
1.18.0