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
qplatformopenglcontext.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
5
#
ifndef
QPLATFORMOPENGLCONTEXT_H
6
#
define
QPLATFORMOPENGLCONTEXT_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is part of the QPA API and is not meant to be used
13
// in applications. Usage of this API may make your code
14
// source and binary incompatible with future versions of Qt.
15
//
16
17
#
include
<
QtGui
/
qtguiglobal
.
h
>
18
#
include
<
QtCore
/
qnamespace
.
h
>
19
20
#
ifndef
QT_NO_OPENGL
21
22
#
include
<
QtGui
/
qsurfaceformat
.
h
>
23
#
include
<
QtGui
/
qwindow
.
h
>
24
#
include
<
QtGui
/
qopengl
.
h
>
25
#
include
<
QtGui
/
qopenglcontext
.
h
>
26
27
#
include
<
QtCore
/
qnativeinterface
.
h
>
28
29
QT_BEGIN_NAMESPACE
30
31
32
class
QPlatformOpenGLContextPrivate;
33
34
class
Q_GUI_EXPORT
QPlatformOpenGLContext
35
{
36
Q_DECLARE_PRIVATE(QPlatformOpenGLContext)
37
public
:
38
QPlatformOpenGLContext();
39
virtual
~QPlatformOpenGLContext();
40
41
virtual
void
initialize
();
42
43
virtual
QSurfaceFormat
format
()
const
= 0;
44
45
virtual
void
swapBuffers
(QPlatformSurface *surface) = 0;
46
47
virtual
GLuint
defaultFramebufferObject
(QPlatformSurface *surface)
const
;
48
49
virtual
bool
makeCurrent
(QPlatformSurface *surface) = 0;
50
virtual
void
doneCurrent
() = 0;
51
52
virtual
void
beginFrame
();
53
virtual
void
endFrame
();
54
55
virtual
bool
isSharing
()
const
{
return
false
; }
56
virtual
bool
isValid
()
const
{
return
true
; }
57
58
virtual
QFunctionPointer
getProcAddress
(
const
char
*procName) = 0;
59
60
QOpenGLContext
*
context
()
const
;
61
62
static
bool
parseOpenGLVersion
(
const
QByteArray &versionString,
int
&major,
int
&minor);
63
64
private
:
65
friend
class
QOpenGLContext;
66
friend
class
QOpenGLContextPrivate
;
67
68
QScopedPointer<QPlatformOpenGLContextPrivate> d_ptr;
69
70
void
setContext(QOpenGLContext *context);
71
72
Q_DISABLE_COPY
(
QPlatformOpenGLContext
)
73
};
74
75
namespace
QNativeInterface::
Private
{
76
77
#
if
defined
(
Q_OS_MACOS
)
78
struct
Q_GUI_EXPORT
QCocoaGLIntegration
79
{
80
QT_DECLARE_NATIVE_INTERFACE
(
QCocoaGLIntegration
)
81
virtual
QOpenGLContext
*
createOpenGLContext
(
NSOpenGLContext
*,
QOpenGLContext
*
shareContext
)
const
= 0;
82
};
83
#
endif
84
85
#
if
defined
(
Q_OS_WIN
)
86
struct
Q_GUI_EXPORT
QWindowsGLIntegration
87
{
88
QT_DECLARE_NATIVE_INTERFACE
(
QWindowsGLIntegration
)
89
virtual
HMODULE
openGLModuleHandle
()
const
= 0;
90
virtual
QOpenGLContext
*
createOpenGLContext
(
HGLRC
context
,
HWND
window
,
QOpenGLContext
*
shareContext
)
const
= 0;
91
};
92
#
endif
93
94
#
if
QT_CONFIG
(
xcb_glx_plugin
)
95
struct
Q_GUI_EXPORT
QGLXIntegration
96
{
97
QT_DECLARE_NATIVE_INTERFACE
(
QGLXIntegration
)
98
virtual
QOpenGLContext
*
createOpenGLContext
(
GLXContext
context
,
void
*
visualInfo
,
QOpenGLContext
*
shareContext
)
const
= 0;
99
};
100
#
endif
101
102
#
if
QT_CONFIG
(
egl
)
103
struct
Q_GUI_EXPORT
QEGLIntegration
104
{
105
QT_DECLARE_NATIVE_INTERFACE
(
QEGLIntegration
)
106
virtual
QOpenGLContext
*
createOpenGLContext
(
EGLContext
context
,
EGLDisplay
display
,
QOpenGLContext
*
shareContext
)
const
= 0;
107
};
108
#
endif
109
110
}
// QNativeInterface::Private
111
112
QT_END_NAMESPACE
113
114
#
endif
// QT_NO_OPENGL
115
116
#
endif
// QPLATFORMOPENGLCONTEXT_H
QImageReader::format
QByteArray format() const
Returns the format QImageReader uses for reading images.
Definition
qimagereader.cpp:606
QPlatformOpenGLContextPrivate
Definition
qplatformopenglcontext.cpp:47
QPlatformOpenGLContextPrivate::context
QOpenGLContext * context
Definition
qplatformopenglcontext.cpp:51
QPlatformOpenGLContextPrivate::QPlatformOpenGLContextPrivate
QPlatformOpenGLContextPrivate()
Definition
qplatformopenglcontext.cpp:49
QPlatformOpenGLContext
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
Definition
qplatformopenglcontext.h:35
QPlatformOpenGLContext::QOpenGLContextPrivate
friend class QOpenGLContextPrivate
Definition
qplatformopenglcontext.h:66
QPlatformOpenGLContext::initialize
virtual void initialize()
Called after a new instance is constructed.
Definition
qplatformopenglcontext.cpp:69
QPlatformOpenGLContext::getProcAddress
virtual QFunctionPointer getProcAddress(const char *procName)=0
Reimplement in subclass to allow dynamic querying of OpenGL symbols.
QPlatformOpenGLContext::swapBuffers
virtual void swapBuffers(QPlatformSurface *surface)=0
Reimplement in subclass to native swap buffers calls.
QPlatformOpenGLContext::makeCurrent
virtual bool makeCurrent(QPlatformSurface *surface)=0
QPlatformOpenGLContext::isSharing
virtual bool isSharing() const
Definition
qplatformopenglcontext.h:55
QPlatformOpenGLContext::doneCurrent
virtual void doneCurrent()=0
QPlatformOpenGLContext::context
QOpenGLContext * context() const
Definition
qplatformopenglcontext.cpp:83
QPlatformOpenGLContext::endFrame
virtual void endFrame()
Called when the RHI ends rendering a in the context.
Definition
qplatformopenglcontext.cpp:145
QPlatformOpenGLContext::defaultFramebufferObject
virtual GLuint defaultFramebufferObject(QPlatformSurface *surface) const
Reimplement in subclass if your platform uses framebuffer objects for surfaces.
Definition
qplatformopenglcontext.cpp:78
QPlatformOpenGLContext::beginFrame
virtual void beginFrame()
Called when the RHI begins rendering a new frame in the context.
Definition
qplatformopenglcontext.cpp:137
QPlatformOpenGLContext::isValid
virtual bool isValid() const
Definition
qplatformopenglcontext.h:56
QPlatformOpenGLContext::parseOpenGLVersion
static bool parseOpenGLVersion(const QByteArray &versionString, int &major, int &minor)
Definition
qplatformopenglcontext.cpp:95
QNativeInterface
Definition
qnativeinterface.h:51
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
gui
kernel
qplatformopenglcontext.h
Generated on
for Qt by
1.18.0