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
qquickgraphicsdevice.h
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKGRAPHICSDEVICE_H
6#define QQUICKGRAPHICSDEVICE_H
7
8#include <QtQuick/qtquickglobal.h>
9
10#if QT_CONFIG(vulkan)
11#include <QtGui/qvulkaninstance.h>
12#endif
13
14#if QT_CONFIG(metal) || defined(Q_QDOC)
15Q_FORWARD_DECLARE_OBJC_CLASS(MTLDevice);
16Q_FORWARD_DECLARE_OBJC_CLASS(MTLCommandQueue);
17#endif
18
19QT_BEGIN_NAMESPACE
20
21class QQuickGraphicsDevicePrivate;
22class QOpenGLContext;
23class QRhi;
24class QRhiAdapter;
25
26class Q_QUICK_EXPORT QQuickGraphicsDevice
27{
28public:
29 QQuickGraphicsDevice();
30 ~QQuickGraphicsDevice();
31 QQuickGraphicsDevice(const QQuickGraphicsDevice &other);
32 QQuickGraphicsDevice &operator=(const QQuickGraphicsDevice &other);
33
34 bool isNull() const;
35
36#if QT_CONFIG(opengl) || defined(Q_QDOC)
37 static QQuickGraphicsDevice fromOpenGLContext(QOpenGLContext *context);
38#endif
39
40#if defined(Q_OS_WIN) || defined(Q_QDOC)
41 static QQuickGraphicsDevice fromAdapter(quint32 adapterLuidLow, qint32 adapterLuidHigh, int featureLevel = 0);
42 static QQuickGraphicsDevice fromDeviceAndContext(void *device, void *context);
43#endif
44
45#if QT_CONFIG(metal) || defined(Q_QDOC)
46 static QQuickGraphicsDevice fromDeviceAndCommandQueue(MTLDevice *device, MTLCommandQueue *commandQueue);
47#endif
48
49#if QT_CONFIG(vulkan) || defined(Q_QDOC)
50 static QQuickGraphicsDevice fromPhysicalDevice(VkPhysicalDevice physicalDevice);
51 static QQuickGraphicsDevice fromDeviceObjects(VkPhysicalDevice physicalDevice, VkDevice device, int queueFamilyIndex, int queueIndex = 0);
52#endif
53
54 static QQuickGraphicsDevice fromRhi(QRhi *rhi);
55 static QQuickGraphicsDevice fromRhiAdapter(QRhiAdapter *adapter);
56
57private:
58 void detach();
59 QQuickGraphicsDevicePrivate *d;
60 friend class QQuickGraphicsDevicePrivate;
61};
62
63QT_END_NAMESPACE
64
65#endif // QQUICKGRAPHICSDEVICE_H
The QQuickGraphicsDevice class provides an opaque container for native graphics objects representing ...