aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pugl_vulkan_demo.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-20 14:23:41 -0400
committerDavid Robillard <d@drobilla.net>2022-05-21 16:49:47 -0400
commit1cd37cad0a06fbb15c44fd59dd6b2c12a0812a76 (patch)
treed7760c11195b003dc27a6f86f0c47df51c0a32da /examples/pugl_vulkan_demo.c
parent0fc1422e858bf9849b84aee2abeca3b553214b73 (diff)
downloadpugl-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_demo.c')
-rw-r--r--examples/pugl_vulkan_demo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/pugl_vulkan_demo.c b/examples/pugl_vulkan_demo.c
index b7ff146..ec465bb 100644
--- a/examples/pugl_vulkan_demo.c
+++ b/examples/pugl_vulkan_demo.c
@@ -1036,9 +1036,8 @@ main(int argc, char** argv)
memset(&app, 0, sizeof(app));
VulkanState* vk = &app.vk;
- const uint32_t defaultWidth = 640;
- const uint32_t defaultHeight = 360;
- const PuglRect frame = {0, 0, defaultWidth, defaultHeight};
+ const PuglSpan defaultWidth = 640;
+ const PuglSpan defaultHeight = 360;
// Parse command line options
app.opts = puglParseTestOptions(&argc, &argv);
@@ -1065,7 +1064,7 @@ main(int argc, char** argv)
// Create window
puglSetWindowTitle(app.view, "Pugl Vulkan Demo");
- puglSetFrame(app.view, frame);
+ puglSetSizeHint(app.view, PUGL_DEFAULT_SIZE, defaultWidth, defaultHeight);
puglSetHandle(app.view, &app);
puglSetBackend(app.view, puglVulkanBackend());
puglSetViewHint(app.view, PUGL_RESIZABLE, app.opts.resizable);