From fb895169baf3771e47b69e02b92e9efc48e09028 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sat, 23 Nov 2024 16:01:23 +0100 Subject: [PATCH] Code cleanup --- examples/triangle/triangle.cpp | 10 +++++----- examples/trianglevulkan13/trianglevulkan13.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index 7f7eee03a..b8ca7ede5 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -44,23 +44,23 @@ class VulkanExample : public VulkanExampleBase // Vertex buffer and attributes struct { VkDeviceMemory memory{ VK_NULL_HANDLE }; // Handle to the device memory for this buffer - VkBuffer buffer; // Handle to the Vulkan buffer object that the memory is bound to + VkBuffer buffer{ VK_NULL_HANDLE }; // Handle to the Vulkan buffer object that the memory is bound to } vertices; // Index buffer struct { VkDeviceMemory memory{ VK_NULL_HANDLE }; - VkBuffer buffer; + VkBuffer buffer{ VK_NULL_HANDLE }; uint32_t count{ 0 }; } indices; // Uniform buffer block object struct UniformBuffer { - VkDeviceMemory memory; - VkBuffer buffer; + VkDeviceMemory memory{ VK_NULL_HANDLE }; + VkBuffer buffer{ VK_NULL_HANDLE }; // The descriptor set stores the resources bound to the binding points in a shader // It connects the binding points of the different shaders with the buffers and images used for those bindings - VkDescriptorSet descriptorSet; + VkDescriptorSet descriptorSet{ VK_NULL_HANDLE }; // We keep a pointer to the mapped buffer, so we can easily update it's contents via a memcpy uint8_t* mapped{ nullptr }; }; diff --git a/examples/trianglevulkan13/trianglevulkan13.cpp b/examples/trianglevulkan13/trianglevulkan13.cpp index a6c9eb178..e143fa0ec 100644 --- a/examples/trianglevulkan13/trianglevulkan13.cpp +++ b/examples/trianglevulkan13/trianglevulkan13.cpp @@ -53,7 +53,7 @@ class VulkanExample : public VulkanExampleBase struct UniformBuffer : VulkanBuffer { // The descriptor set stores the resources bound to the binding points in a shader // It connects the binding points of the different shaders with the buffers and images used for those bindings - VkDescriptorSet descriptorSet; + VkDescriptorSet descriptorSet{ VK_NULL_HANDLE }; // We keep a pointer to the mapped buffer, so we can easily update it's contents via a memcpy uint8_t* mapped{ nullptr }; }; @@ -817,7 +817,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return (DefWindowProc(hWnd, uMsg, wParam, lParam)); } -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, int nCmdShow) +int APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR, _In_ int) { for (size_t i = 0; i < __argc; i++) { VulkanExample::args.push_back(__argv[i]); }; vulkanExample = new VulkanExample();