QSGMetalTexture Struct
struct QNativeInterface::QSGMetalTextureProvides access to and enables adopting Metal texture objects. \since
6.0. More...
Header: | #include <QSGTexture> |
Public Functions
int | nativeTexture() const |
Static Public Members
QSGTexture * | fromNative(int texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {}) |
Detailed Description
\inmodule
QtQuick \ingroup
native-interfaces \ingroup
native-interfaces-qsgtexture
Member Function Documentation
[static]
QSGTexture *QSGMetalTexture::fromNative(int texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})
Creates a new QSGTexture wrapping an existing Metal texture object for window.
The native object is wrapped, but not owned, by the resulting QSGTexture. The caller of the function is responsible for deleting the returned QSGTexture, but that will not destroy the underlying native object.
This function is currently suitable for 2D RGBA textures only.
Warning: This function will return null if the scene graph has not yet been initialized.
Use options to customize the texture attributes. Only the TextureHasAlphaChannel and TextureHasMipmaps are taken into account here.
size specifies the size in pixels.
Note: This function must be called on the scene graph rendering thread.
\since
6.0
See also QQuickWindow::sceneGraphInitialized(), QSGTexture, Scene Graph - Metal Texture Import, and Scene Graph - Vulkan Texture Import.
int QSGMetalTexture::nativeTexture() const
Returns the Metal texture object.