Crafter.Graphics/examples/VulkanTriangle/README.md

25 lines
697 B
Markdown
Raw Permalink Normal View History

2025-06-13 23:59:36 +02:00
# HelloWindow Example
## Description
This example demonstrates how to load shaders and render a triangle.
## Expected Result
A blue tinted vulkan window with a white triangle in the center.
## Highlighted Code Snippet
```cpp
EventListener<VkCommandBuffer> listener(&window.onDraw, [&descriptors, &meshShader](VkCommandBuffer cmd){
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, Pipeline::pipelineLayout, 0, 2, &descriptors.set[0], 0, NULL);
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, Pipeline::pipeline);
VulkanDevice::vkCmdDrawMeshTasksEXTProc(cmd, meshShader.threadCount, 1, 1);
});
```
## How to Run
```bash
2025-11-16 18:52:52 +01:00
crafter-build build executable -r
```