Sur cette page

QNativeInterface::QSGD3D11Texture Struct

Permet d'accéder aux objets de texture Direct3D 11 et de les adopter. Plus...

En-tête : #include <QSGTexture>
CMake : find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake : QT += quick
Depuis : Qt 6.0

Fonctions publiques

virtual void *nativeTexture() const = 0

Membres publics statiques

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

Description détaillée

Documentation des fonctions membres

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

Crée un nouvel objet QSGTexture enveloppant un objet Direct 3D 11 texture existant pour window.

L'objet natif est enveloppé, mais n'appartient pas à l'objet QSGTexture résultant. L'appelant de la fonction est responsable de la suppression de l'objet QSGTexture retourné, mais cela ne détruira pas l'objet natif sous-jacent.

Cette fonction ne convient actuellement qu'aux textures RGBA 2D.

Attention : Cette fonction renverra null si le graphe de scène n'a pas encore été initialisé.

Utilisez options pour personnaliser les attributs de la texture. Seuls les attributs TextureHasAlphaChannel et TextureHasMipmaps sont pris en compte ici.

size spécifie la taille en pixels.

Note : Cette fonction doit être appelée sur le thread de rendu du graphe de scène.

Cette fonction a été introduite dans Qt 6.0.

Voir aussi QQuickWindow::sceneGraphInitialized(), QSGTexture, Scene Graph - Metal Texture Import, et Scene Graph - Vulkan Texture Import.

[pure virtual] void *QSGD3D11Texture::nativeTexture() const

Renvoie l'objet ID3D11Texture2D.

© 2026 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.