QSGD3D12Texture Struct

struct QNativeInterface ::QSGD3D12Texture

Provides access to and enables adopting Direct3D 12 texture objects. 更多...

頭: #include <QSGTexture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Since: Qt 6.6

公共函數

virtual void * nativeTexture () const = 0

靜態公共成員

(從 6.6 起) QSGTexture * fromNative (void * texture , int resourceState , QQuickWindow * window , const QSize & size , QQuickWindow::CreateTextureOptions options = {})

詳細描述

成員函數文檔編製

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

創建新的 QSGTexture wrapping an existing Direct 3D 12 texture 對象為 window .

本機對象被包裹 (但不歸其所有) 通過結果 QSGTexture 。函數調用者負責刪除返迴的 QSGTexture ,但不會銷毀底層本機對象。

此函數目前僅適於 2D RGBA 紋理。

警告: 此函數將返迴 null,若場景圖形尚未初始化。

使用 options 以自定義紋理屬性。這裏隻考慮 TextureHasAlphaChannel 和 TextureHasMipmaps。

size 指定大小 (以像素為單位)。

resourceState must specify the current state of the texture resource.

注意: 必須在場景圖形渲染綫程中調用此函數。

該函數在 Qt 6.6 引入。

另請參閱 QQuickWindow::sceneGraphInitialized (), QSGTexture , 場景圖形 - Metal 紋理導入 ,和 場景圖形 - Vulkan 紋理導入 .

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

Returns the ID3D12Texture object.