aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickgraphicsdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickgraphicsdevice.h')
-rw-r--r--src/quick/items/qquickgraphicsdevice.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/quick/items/qquickgraphicsdevice.h b/src/quick/items/qquickgraphicsdevice.h
new file mode 100644
index 0000000000..d668f5e576
--- /dev/null
+++ b/src/quick/items/qquickgraphicsdevice.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QQUICKGRAPHICSDEVICE_H
+#define QQUICKGRAPHICSDEVICE_H
+
+#include <QtQuick/qtquickglobal.h>
+
+#if QT_CONFIG(vulkan)
+#include <QtGui/qvulkaninstance.h>
+#endif
+
+#if QT_CONFIG(metal) || defined(Q_QDOC)
+Q_FORWARD_DECLARE_OBJC_CLASS(MTLDevice);
+Q_FORWARD_DECLARE_OBJC_CLASS(MTLCommandQueue);
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QQuickGraphicsDevicePrivate;
+class QOpenGLContext;
+class QRhi;
+
+class Q_QUICK_EXPORT QQuickGraphicsDevice
+{
+public:
+ QQuickGraphicsDevice();
+ ~QQuickGraphicsDevice();
+ QQuickGraphicsDevice(const QQuickGraphicsDevice &other);
+ QQuickGraphicsDevice &operator=(const QQuickGraphicsDevice &other);
+
+ bool isNull() const;
+
+#if QT_CONFIG(opengl) || defined(Q_QDOC)
+ static QQuickGraphicsDevice fromOpenGLContext(QOpenGLContext *context);
+#endif
+
+#if defined(Q_OS_WIN) || defined(Q_QDOC)
+ static QQuickGraphicsDevice fromAdapter(quint32 adapterLuidLow, qint32 adapterLuidHigh, int featureLevel = 0);
+ static QQuickGraphicsDevice fromDeviceAndContext(void *device, void *context);
+#endif
+
+#if QT_CONFIG(metal) || defined(Q_QDOC)
+ static QQuickGraphicsDevice fromDeviceAndCommandQueue(MTLDevice *device, MTLCommandQueue *commandQueue);
+#endif
+
+#if QT_CONFIG(vulkan) || defined(Q_QDOC)
+ static QQuickGraphicsDevice fromPhysicalDevice(VkPhysicalDevice physicalDevice);
+ static QQuickGraphicsDevice fromDeviceObjects(VkPhysicalDevice physicalDevice, VkDevice device, int queueFamilyIndex, int queueIndex = 0);
+#endif
+
+ static QQuickGraphicsDevice fromRhi(QRhi *rhi);
+
+private:
+ void detach();
+ QQuickGraphicsDevicePrivate *d;
+ friend class QQuickGraphicsDevicePrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKGRAPHICSDEVICE_H