Skip to content

Commit

Permalink
indent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alihuawei committed Dec 10, 2024
1 parent 06440fc commit 11c4517
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions samples/api/hello_triangle_1_3/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -126,37 +126,37 @@ Unlike the original sample, which used hard-coded vertices in the shader, this s
- **Vertex Structure Defined:**
```cpp
```cpp
struct Vertex {
glm::vec2 position;
glm::vec3 color;
};
```
```
- **Vertex Data Stored in a Buffer:**
```cpp
```cpp
std::vector<Vertex> vertices = {
{{0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}}, // Red Vertex
// ... other vertices ...
};
```
```
- **Buffer Creation and Memory Allocation:**
```cpp
```cpp
VkBufferCreateInfo buffer_info = { /* ... */ };
vkCreateBuffer(device, &buffer_info, nullptr, &vertex_buffer);
VkMemoryAllocateInfo alloc_info = { /* ... */ };
vkAllocateMemory(device, &alloc_info, nullptr, &vertex_buffer_memory);
```
```
- **Binding the Vertex Buffer:**
```cpp
```cpp
vkCmdBindVertexBuffers(cmd, 0, 1, &vertex_buffer, &offset);
```
```
**Benefits:**
Expand Down

0 comments on commit 11c4517

Please sign in to comment.