QSGVulkanTexture Struct

struct QNativeInterface::QSGVulkanTexture

Ermöglicht den Zugriff auf und die Übernahme von Vulkan-Bildobjekten. 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

virtual VkImage nativeImage() const = 0
virtual VkImageLayout nativeImageLayout() const = 0

Statische öffentliche Mitglieder

(since 6.0) QSGTexture *fromNative(VkImage image, VkImageLayout layout, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})

Detaillierte Beschreibung

Dokumentation der Mitgliedsfunktionen

[static, since 6.0] QSGTexture *QSGVulkanTexture::fromNative(VkImage image, VkImageLayout layout, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {})

Erzeugt ein neues QSGTexture, das ein vorhandenes Vulkan image Objekt für window umhüllt.

Das native Objekt wird von dem resultierenden QSGTexture umhüllt, ist aber nicht sein Eigentum. 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.

layout muss das aktuelle Layout des Bildes angeben.

Verwenden Sie options, um die Texturattribute anzupassen. Nur die TextureHasAlphaChannel und TextureHasMipmaps werden hier 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.

[pure virtual] VkImage QSGVulkanTexture::nativeImage() const

Gibt das VkImage-Handle zurück.

[pure virtual] VkImageLayout QSGVulkanTexture::nativeImageLayout() const

Gibt das Bildlayout 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.