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
qquickgraphicsdevice.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 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
5
7
27
31void QQuickGraphicsDevice::detach()
32{
34}
35
44
53
58{
59 if (!d->ref.deref())
60 delete d;
61}
62
68{
69 return d->type == QQuickGraphicsDevicePrivate::Type::Null;
70}
71
82#if QT_CONFIG(opengl) || defined(Q_QDOC)
83QQuickGraphicsDevice QQuickGraphicsDevice::fromOpenGLContext(QOpenGLContext *context)
84{
87 d->type = QQuickGraphicsDevicePrivate::Type::OpenGLContext;
88 d->u.context = context;
89 return dev;
90}
91#endif
92
105#if defined(Q_OS_WIN) || defined(Q_QDOC)
106QQuickGraphicsDevice QQuickGraphicsDevice::fromAdapter(quint32 adapterLuidLow,
107 qint32 adapterLuidHigh,
108 int featureLevel)
109{
112 d->type = QQuickGraphicsDevicePrivate::Type::Adapter;
113 d->u.adapter = { adapterLuidLow, adapterLuidHigh, featureLevel };
114 return dev;
115}
116#endif
117
134#if defined(Q_OS_WIN) || defined(Q_QDOC)
135QQuickGraphicsDevice QQuickGraphicsDevice::fromDeviceAndContext(void *device, void *context)
136{
139 d->type = QQuickGraphicsDevicePrivate::Type::DeviceAndContext;
140 d->u.deviceAndContext = { device, context };
141 return dev;
142}
143#endif
144
156#if QT_CONFIG(metal) || defined(Q_QDOC)
157QQuickGraphicsDevice QQuickGraphicsDevice::fromDeviceAndCommandQueue(MTLDevice *device,
158 MTLCommandQueue *commandQueue)
159{
162 d->type = QQuickGraphicsDevicePrivate::Type::DeviceAndCommandQueue;
163 d->u.deviceAndCommandQueue = { device, commandQueue };
164 return dev;
165}
166#endif
167
178#if QT_CONFIG(vulkan) || defined(Q_QDOC)
179QQuickGraphicsDevice QQuickGraphicsDevice::fromPhysicalDevice(VkPhysicalDevice physicalDevice)
180{
183 d->type = QQuickGraphicsDevicePrivate::Type::PhysicalDevice;
184 d->u.physicalDevice = { physicalDevice };
185 return dev;
186}
187#endif
188
200#if QT_CONFIG(vulkan) || defined(Q_QDOC)
201QQuickGraphicsDevice QQuickGraphicsDevice::fromDeviceObjects(VkPhysicalDevice physicalDevice,
202 VkDevice device,
203 int queueFamilyIndex,
204 int queueIndex)
205{
208 d->type = QQuickGraphicsDevicePrivate::Type::DeviceObjects;
209 d->u.deviceObjects = { physicalDevice, device, queueFamilyIndex, queueIndex };
210 return dev;
211}
212#endif
213
225{
228 d->type = QQuickGraphicsDevicePrivate::Type::Rhi;
229 d->u.rhi = rhi;
230 return dev;
231}
232
237
244
IOBluetoothDevice * device
bool ref() noexcept
bool deref() noexcept
\inmodule QtGui
static QQuickGraphicsDevicePrivate * get(QQuickGraphicsDevice *p)
The QQuickGraphicsDevice class provides an opaque container for native graphics objects representing ...
QQuickGraphicsDevice & operator=(const QQuickGraphicsDevice &other)
static QQuickGraphicsDevice fromRhi(QRhi *rhi)
QQuickGraphicsDevice()
Constructs a default QQuickGraphicsDevice that does not reference any native objects.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
Combined button and popup list for selecting options.
static void * context
QT_WARNING_POP void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
Definition qatomic.h:180
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
Definition qatomic.h:199
GLenum type
GLint ref
unsigned int quint32
Definition qtypes.h:50
int qint32
Definition qtypes.h:49
QSharedPointer< T > other(t)
[5]