Skip to content

Commit 1eb2223

Browse files
authored
A collection of minor fixes (#330)
* Apply coherent indentation all over the file * Use static_cast to perform casting * Add three dots to indicate that it isn't the top of the function
1 parent b811ac1 commit 1eb2223

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

code/15_hello_triangle.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -599,23 +599,23 @@ class HelloTriangleApplication {
599599

600600
vkCmdBeginRenderPass(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
601601

602-
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);
603-
604-
VkViewport viewport{};
605-
viewport.x = 0.0f;
606-
viewport.y = 0.0f;
607-
viewport.width = (float) swapChainExtent.width;
608-
viewport.height = (float) swapChainExtent.height;
609-
viewport.minDepth = 0.0f;
610-
viewport.maxDepth = 1.0f;
611-
vkCmdSetViewport(commandBuffer, 0, 1, &viewport);
612-
613-
VkRect2D scissor{};
614-
scissor.offset = {0, 0};
615-
scissor.extent = swapChainExtent;
616-
vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
617-
618-
vkCmdDraw(commandBuffer, 3, 1, 0, 0);
602+
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);
603+
604+
VkViewport viewport{};
605+
viewport.x = 0.0f;
606+
viewport.y = 0.0f;
607+
viewport.width = static_cast<float>(swapChainExtent.width);
608+
viewport.height = static_cast<float>(swapChainExtent.height);
609+
viewport.minDepth = 0.0f;
610+
viewport.maxDepth = 1.0f;
611+
vkCmdSetViewport(commandBuffer, 0, 1, &viewport);
612+
613+
VkRect2D scissor{};
614+
scissor.offset = {0, 0};
615+
scissor.extent = swapChainExtent;
616+
vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
617+
618+
vkCmdDraw(commandBuffer, 3, 1, 0, 0);
619619

620620
vkCmdEndRenderPass(commandBuffer);
621621

en/03_Drawing_a_triangle/03_Drawing/02_Rendering_and_presentation.md

+2
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ must use a function with the `vk*KHR` naming convention:
308308

309309
```c++
310310
void drawFrame() {
311+
...
312+
311313
uint32_t imageIndex;
312314
vkAcquireNextImageKHR(device, swapChain, UINT64_MAX, imageAvailableSemaphore, VK_NULL_HANDLE, &imageIndex);
313315
}

0 commit comments

Comments
 (0)