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.