Provides access to and enables adopting Vulkan image 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 VkImage | nativeImage () const = 0 |
| virtual VkImageLayout | nativeImageLayout () const = 0 |
| QSGTexture * | fromNative (VkImage image , VkImageLayout layout , QQuickWindow * window , const QSize & size , QQuickWindow::CreateTextureOptions options = {}) |
[static, since 6.0]
QSGTexture
*QSGVulkanTexture::
fromNative
(
VkImage
image
,
VkImageLayout
layout
,
QQuickWindow
*
window
, const
QSize
&
size
,
QQuickWindow::CreateTextureOptions
options
= {})
创建新的 QSGTexture wrapping an existing Vulkan image 对象为 window .
本机对象被包裹 (但不归其所有) 通过结果 QSGTexture 。函数调用者负责删除返回的 QSGTexture ,但不会销毁底层本机对象。
此函数目前仅适于 2D RGBA 纹理。
警告: This function will return null if the scene graph has not yet been initialized.
layout must specify the current layout of the image.
使用 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]
VkImage
QSGVulkanTexture::
nativeImage
() const
Returns the VkImage handle.
[pure virtual]
VkImageLayout
QSGVulkanTexture::
nativeImageLayout
() const
Returns the image layout.