QSGD3D11Texture Struct

struct QNativeInterface ::QSGD3D11Texture

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

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

公共函數

virtual void * nativeTexture () const = 0

靜態公共成員

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

詳細描述

成員函數文檔編製

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

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

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

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

警告: This function will return null if the scene graph has not yet been initialized.

使用 options to customize the texture attributes. Only the TextureHasAlphaChannel and TextureHasMipmaps are taken into account here.

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

注意: This function must be called on the scene graph rendering thread.

該函數在 Qt 6.0 引入。

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

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

Returns the ID3D11Texture2D object.