diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index 054af82e6..7f7eee03a 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -259,7 +259,7 @@ class VulkanExample : public VulkanExampleBase struct { StagingBuffer vertices; StagingBuffer indices; - } stagingBuffers; + } stagingBuffers{}; void* data; @@ -373,7 +373,7 @@ class VulkanExample : public VulkanExampleBase void createDescriptorPool() { // We need to tell the API the number of max. requested descriptors per type - VkDescriptorPoolSize descriptorTypeCounts[1]; + VkDescriptorPoolSize descriptorTypeCounts[1]{}; // This example only one descriptor type (uniform buffer) descriptorTypeCounts[0].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; // We have one buffer (and as such descriptor) per frame @@ -508,7 +508,7 @@ class VulkanExample : public VulkanExampleBase frameBuffers.resize(swapChain.imageCount); for (size_t i = 0; i < frameBuffers.size(); i++) { - std::array attachments; + std::array attachments{}; // Color attachment is the view of the swapchain image attachments[0] = swapChain.buffers[i].view; // Depth/Stencil attachment is the same for all frame buffers due to how depth works with current GPUs @@ -587,7 +587,7 @@ class VulkanExample : public VulkanExampleBase // Each subpass dependency will introduce a memory and execution dependency between the source and dest subpass described by // srcStageMask, dstStageMask, srcAccessMask, dstAccessMask (and dependencyFlags is set) // Note: VK_SUBPASS_EXTERNAL is a special constant that refers to all commands executed outside of the actual renderpass) - std::array dependencies; + std::array dependencies{}; // Does the transition from final to initial layout for the depth an color attachments // Depth attachment @@ -943,7 +943,7 @@ class VulkanExample : public VulkanExampleBase // Set clear values for all framebuffer attachments with loadOp set to clear // We use two attachments (color and depth) that are cleared at the start of the subpass and as such we need to set clear values for both - VkClearValue clearValues[2]; + VkClearValue clearValues[2]{}; clearValues[0].color = { { 0.0f, 0.0f, 0.2f, 1.0f } }; clearValues[1].depthStencil = { 1.0f, 0 }; @@ -1056,7 +1056,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(); diff --git a/examples/trianglevulkan13/trianglevulkan13.cpp b/examples/trianglevulkan13/trianglevulkan13.cpp index 261c03133..1cfa6bbd2 100644 --- a/examples/trianglevulkan13/trianglevulkan13.cpp +++ b/examples/trianglevulkan13/trianglevulkan13.cpp @@ -243,7 +243,7 @@ class VulkanExample : public VulkanExampleBase VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, &stagingBuffer.memory)); VK_CHECK_RESULT(vkBindBufferMemory(device, stagingBuffer.handle, stagingBuffer.memory, 0)); // Map the buffer and copy vertices and indices into it, this way we can use a single buffer as the source for both vertex and index GPU buffers - uint8_t* data; + uint8_t* data{ nullptr }; VK_CHECK_RESULT(vkMapMemory(device, stagingBuffer.memory, 0, memAlloc.allocationSize, 0, (void**)&data)); memcpy(data, vertices.data(), vertexBufferSize); memcpy(((char*)data) + vertexBufferSize, indices.data(), vertexBufferSize);