提供對 Direct3D 11 紋理對象的訪問和啓用采納。 更多...
| 頭: |
#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 |
(從 6.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 包裹現有 Direct 3D 11 texture 對象為 window .
本機對象被包裹 (但不歸其所有) 通過結果 QSGTexture 。函數調用者負責刪除返迴的 QSGTexture ,但不會銷毀底層本機對象。
此函數目前僅適於 2D RGBA 紋理。
警告: 此函數將返迴 null,若場景圖形尚未初始化。
使用 options 以自定義紋理屬性。這裏隻考慮 TextureHasAlphaChannel 和 TextureHasMipmaps。
size 指定大小 (以像素為單位)。
注意: 必須在場景圖形渲染綫程中調用此函數。
該函數在 Qt 6.0 引入。
另請參閱 QQuickWindow::sceneGraphInitialized (), QSGTexture , 場景圖形 - Metal 紋理導入 ,和 場景圖形 - Vulkan 紋理導入 .
[pure virtual]
void
*QSGD3D11Texture::
nativeTexture
() const
返迴 ID3D11Texture2D 對象。