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
qsgtexture_platform.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
4#ifndef QSGTEXTURE_PLATFORM_H
5#define QSGTEXTURE_PLATFORM_H
6
7#include <QtCore/qnativeinterface.h>
8#include <QtQuick/qquickwindow.h>
9
10#if QT_CONFIG(opengl)
11#include <QtGui/qopengl.h>
12#endif
13
14#if QT_CONFIG(vulkan)
15#include <QtGui/qvulkaninstance.h>
16#endif
17
18#if QT_CONFIG(metal) || defined(Q_QDOC)
19# if defined(__OBJC__) || defined(Q_QDOC)
20 @protocol MTLTexture;
21# define QT_OBJC_PROTOCOL(protocol) id<protocol>
22# else
23 typedef struct objc_object *id;
24# define QT_OBJC_PROTOCOL(protocol) id
25# endif
26#endif
27
29
30namespace QNativeInterface {
31
32#if QT_CONFIG(opengl) || defined(Q_QDOC)
33struct Q_QUICK_EXPORT QSGOpenGLTexture
34{
35 QT_DECLARE_NATIVE_INTERFACE(QSGOpenGLTexture, 1, QSGTexture)
36 virtual GLuint nativeTexture() const = 0;
37 static QSGTexture *fromNative(GLuint textureId,
39 const QSize &size,
40 QQuickWindow::CreateTextureOptions options = {});
41 static QSGTexture *fromNativeExternalOES(GLuint textureId,
43 const QSize &size,
44 QQuickWindow::CreateTextureOptions options = {});
45};
46#endif
47
48#if defined(Q_OS_WIN) || defined(Q_QDOC)
49struct Q_QUICK_EXPORT QSGD3D11Texture
50{
51 QT_DECLARE_NATIVE_INTERFACE(QSGD3D11Texture, 1, QSGTexture)
52 virtual void *nativeTexture() const = 0;
53 static QSGTexture *fromNative(void *texture,
55 const QSize &size,
56 QQuickWindow::CreateTextureOptions options = {});
57};
58struct Q_QUICK_EXPORT QSGD3D12Texture
59{
60 QT_DECLARE_NATIVE_INTERFACE(QSGD3D12Texture, 1, QSGTexture)
61 virtual void *nativeTexture() const = 0;
62 virtual int nativeResourceState() const = 0;
63 static QSGTexture *fromNative(void *texture,
64 int resourceState,
66 const QSize &size,
67 QQuickWindow::CreateTextureOptions options = {});
68};
69#endif
70
71#if QT_CONFIG(metal) || defined(Q_QDOC)
72struct Q_QUICK_EXPORT QSGMetalTexture
73{
74 QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture, 1, QSGTexture)
75 virtual QT_OBJC_PROTOCOL(MTLTexture) nativeTexture() const = 0;
76 static QSGTexture *fromNative(QT_OBJC_PROTOCOL(MTLTexture) texture,
78 const QSize &size,
79 QQuickWindow::CreateTextureOptions options = {});
80};
81#endif
82
83#if QT_CONFIG(vulkan) || defined(Q_QDOC)
84struct Q_QUICK_EXPORT QSGVulkanTexture
85{
86 QT_DECLARE_NATIVE_INTERFACE(QSGVulkanTexture, 1, QSGTexture)
87 virtual VkImage nativeImage() const = 0;
88 virtual VkImageLayout nativeImageLayout() const = 0;
89 static QSGTexture *fromNative(VkImage image,
90 VkImageLayout layout,
92 const QSize &size,
93 QQuickWindow::CreateTextureOptions options = {});
94};
95#endif
96
97} // QNativeInterface
98
100
101#endif // QSGTEXTURE_PLATFORM_H
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
T fromNative(const T &value, qreal scaleFactor, QPoint origin=QPoint(0, 0))
Combined button and popup list for selecting options.
Definition image.cpp:4
#define QT_DECLARE_NATIVE_INTERFACE(...)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint id
[7]
GLenum GLuint texture
#define GLuint
QVBoxLayout * layout
aWidget window() -> setWindowTitle("New Window Title")
[2]