diff options
author | David Robillard <d@drobilla.net> | 2022-10-07 15:16:55 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-10-07 15:16:55 -0400 |
commit | ed4c8a50505ab02a8f3a01e41f5f86acca04b81d (patch) | |
tree | 3c06732998db625fb771bbaeab69d249bf7ba517 /examples/pugl_vulkan_cpp_demo.cpp | |
parent | 92132eca5e75d3f95a3eb7e015c47765a79925cc (diff) | |
download | pugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.tar.gz pugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.tar.bz2 pugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.zip |
Avoid C-style casts in C++ code
Diffstat (limited to 'examples/pugl_vulkan_cpp_demo.cpp')
-rw-r--r-- | examples/pugl_vulkan_cpp_demo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/pugl_vulkan_cpp_demo.cpp b/examples/pugl_vulkan_cpp_demo.cpp index c901de5..7e0bd38 100644 --- a/examples/pugl_vulkan_cpp_demo.cpp +++ b/examples/pugl_vulkan_cpp_demo.cpp @@ -272,7 +272,7 @@ selectPresentMode(const sk::VulkanApi& vk, return r; } - const auto& tryModes = priorities[bool(multiBuffer)][bool(sync)]; + const auto& tryModes = priorities[multiBuffer][sync]; for (const auto m : tryModes) { if (std::find(modes.begin(), modes.end(), m) != modes.end()) { presentMode = m; @@ -896,8 +896,8 @@ RectPipeline::init(const sk::VulkanApi& vk, const VkViewport viewport{0.0f, 0.0f, - float(swapchain.extent.width), - float(swapchain.extent.height), + static_cast<float>(swapchain.extent.width), + static_cast<float>(swapchain.extent.height), 0.0f, 1.0f}; @@ -1560,9 +1560,9 @@ update(PuglVulkanDemo& app, const double time) UniformBufferObject ubo = {{}}; mat4Ortho(ubo.projection, 0.0f, - float(app.renderer.swapchain.extent.width), + static_cast<float>(app.renderer.swapchain.extent.width), 0.0f, - float(app.renderer.swapchain.extent.height), + static_cast<float>(app.renderer.swapchain.extent.height), -1.0f, 1.0f); |