内容表

上一话题

Hello Vulkan Triangle Example

下一话题

Hello Vulkan 窗口范例

Hello Vulkan 小部件范例

Shows the usage of QVulkanWindow in QWidget applications.

Hello Vulkan 小部件范例 is a variant of hellovulkantriangle that embeds the QVulkanWindow QWidget -based user interface using createWindowContainer() .

../_images/hellovulkanwidget.png

The code to set up the Vulkan pipeline and render the triangle is the same as in hellovulkantriangle . In addition, this example demonstrates another feature of QVulkanWindow : reading the image content back from the color buffer into a QImage . By clicking the Grab button, the example renders the next frame and follows it up with a transfer operation in order to get the swapchain color buffer content copied into host accessible memory. The image is then saved to disk via save() .

运行范例

要运行范例从 Qt Creator ,打开 欢迎 模式,然后选择范例从 范例 . For more information, visit Building and Running an Example.

范例工程 @ code.qt.io