QRhiAdapter Class
代表物理图形设备。更多
头文件: | #include <rhi/qrhi.h> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
qmake: | QT += gui-private |
自 | Qt 6.10 |
公共函数
virtual QRhiDriverInfo | info() const = 0 |
详细说明
一些QRhi 后端以图形 API 为目标,这些 API 公开了adapters
或physical devices
的概念。调用静态enumerateAdapters() 函数可获取系统中存在的适配器列表。将返回的 QRhiAdapter 对象之一传递给create() 以请求使用 QRhiAdapter 对应的适配器或物理设备。除了公开QRhiDriverInfo 之外,QRhiAdapter 将被视为一个不透明句柄。
注意: 对于 Vulkan,只有在enumerateAdapters() 所用的QVulkanInstance 有效时,QRhiAdapter 才有效。这也意味着 QRhiAdapter 与 Vulkan 实例 (QVulkanInstance,VkInstance
) 绑定,不能在另一个 Vulkan 实例的上下文中使用。
注: 这是一个兼容性保证有限的 RHI API,详情请参见QRhi 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.