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

静态公共成员

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.