aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-08-29 14:20:39 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-08-30 12:53:54 +0200
commita6323d1ad8ad7af585ed76a5a3a97a48e955ff91 (patch)
tree2cb4f43469df538b6b737660b95a61c47988d61a /src/quick/items/qquickwindow.h
parentcefab21cbd464171f0f90de9ac12c6174ecd7d59 (diff)
Add a createTextureFromId() alternative
Say hello to createTextureFromNativeObject(). This is the future replaecment for createTextureFromId(), and is capable of operating on both the direct OpenGL and the RHI code paths. In practice this allows creating a QSGTexture that wraps - but does not own - an existing VkImage, ID3D11Texture2D*, MTLTexture*, or GLuint. Change-Id: I500ee4c76da67eca1a70599a30b03d7b126b570d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.h')
-rw-r--r--src/quick/items/qquickwindow.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index ab3046611f..9dbff88f0d 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -109,6 +109,11 @@ public:
};
Q_ENUM(TextRenderType)
+ enum NativeObjectType {
+ NativeObjectTexture
+ };
+ Q_ENUM(NativeObjectType)
+
explicit QQuickWindow(QWindow *parent = nullptr);
explicit QQuickWindow(QQuickRenderControl *renderControl);
@@ -153,6 +158,11 @@ public:
QSGTexture *createTextureFromImage(const QImage &image) const;
QSGTexture *createTextureFromImage(const QImage &image, CreateTextureOptions options) const;
QSGTexture *createTextureFromId(uint id, const QSize &size, CreateTextureOptions options = CreateTextureOption()) const;
+ QSGTexture *createTextureFromNativeObject(NativeObjectType type,
+ const void *nativeObjectPtr,
+ int nativeLayout,
+ const QSize &size,
+ CreateTextureOptions options = CreateTextureOption()) const;
void setClearBeforeRendering(bool enabled);
bool clearBeforeRendering() const;