QSGMetalTexture Struct

struct QNativeInterface::QSGMetalTexture

Ermöglicht den Zugriff auf und die Übernahme von Texturobjekten aus Metall. Mehr...

Kopfzeile: #include <QSGTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Seit: Qt 6.0

Öffentliche Funktionen

int nativeTexture() const

Statische öffentliche Mitglieder

(since 6.0) QSGTexture *fromNative(int texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})

Detaillierte Beschreibung

Dokumentation der Mitgliedsfunktionen

[static, since 6.0] QSGTexture *QSGMetalTexture::fromNative(int texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})

Erzeugt ein neues QSGTexture, das ein bestehendes Metal texture Objekt für window umhüllt.

Das native Objekt wird von dem resultierenden QSGTexture umhüllt, aber nicht besessen. Der Aufrufer der Funktion ist dafür verantwortlich, das zurückgegebene QSGTexture zu löschen, aber das zugrunde liegende native Objekt wird dadurch nicht zerstört.

Diese Funktion ist derzeit nur für 2D-RGBA-Texturen geeignet.

Warnung: Diese Funktion gibt Null zurück, wenn der Szenegraph noch nicht initialisiert wurde.

Verwenden Sie options, um die Texturattribute anzupassen. Hier werden nur die TextureHasAlphaChannel und TextureHasMipmaps berücksichtigt.

size gibt die Größe in Pixeln an.

Hinweis: Diese Funktion muss im Rendering-Thread des Szenegraphen aufgerufen werden.

Diese Funktion wurde in Qt 6.0 eingeführt.

Siehe auch QQuickWindow::sceneGraphInitialized(), QSGTexture, Scene Graph - Metal Texture Import, und Scene Graph - Vulkan Texture Import.

int QSGMetalTexture::nativeTexture() const

Gibt das Texturobjekt Metall zurück.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.