diff options
author | David Robillard <d@drobilla.net> | 2022-05-20 14:23:41 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-05-21 16:49:47 -0400 |
commit | 1cd37cad0a06fbb15c44fd59dd6b2c12a0812a76 (patch) | |
tree | d7760c11195b003dc27a6f86f0c47df51c0a32da /examples/pugl_vulkan_cpp_demo.cpp | |
parent | 0fc1422e858bf9849b84aee2abeca3b553214b73 (diff) | |
download | pugl-1cd37cad0a06fbb15c44fd59dd6b2c12a0812a76.tar.gz pugl-1cd37cad0a06fbb15c44fd59dd6b2c12a0812a76.tar.bz2 pugl-1cd37cad0a06fbb15c44fd59dd6b2c12a0812a76.zip |
Add a uniform API for setting size hints
This collapses many functions into one, which makes the API more easily
extensible and reduces code size.
Diffstat (limited to 'examples/pugl_vulkan_cpp_demo.cpp')
-rw-r--r-- | examples/pugl_vulkan_cpp_demo.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/pugl_vulkan_cpp_demo.cpp b/examples/pugl_vulkan_cpp_demo.cpp index 3f635ba..61c7b80 100644 --- a/examples/pugl_vulkan_cpp_demo.cpp +++ b/examples/pugl_vulkan_cpp_demo.cpp @@ -1708,17 +1708,16 @@ run(const char* const programPath, { PuglVulkanDemo app{programPath, opts, numRects}; - VkResult r = VK_SUCCESS; - const auto width = static_cast<int>(app.extent.width); - const auto height = static_cast<int>(app.extent.height); + VkResult r = VK_SUCCESS; + const auto width = app.extent.width; + const auto height = app.extent.height; // Realize window so we can set up Vulkan app.world.setClassName("PuglVulkanCppDemo"); app.view.setWindowTitle("Pugl Vulkan C++ Demo"); - app.view.setAspectRatio(1, 1, 16, 9); - app.view.setDefaultSize(width, height); - app.view.setMinSize(width / 4, height / 4); - app.view.setMaxSize(width * 4, height * 4); + app.view.setSizeHint(pugl::SizeHint::defaultSize, width, height); + app.view.setSizeHint(pugl::SizeHint::minSize, width / 4, height / 4); + app.view.setSizeHint(pugl::SizeHint::maxSize, width * 4, height * 4); app.view.setBackend(pugl::vulkanBackend()); app.view.setHint(pugl::ViewHint::resizable, opts.resizable); const pugl::Status st = app.view.realize(); |