aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_size.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 /test/test_size.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 'test/test_size.c')
-rw-r--r--test/test_size.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/test_size.c b/test/test_size.c
index 862eba5..048bfa5 100644
--- a/test/test_size.c
+++ b/test/test_size.c
@@ -69,9 +69,9 @@ onEvent(PuglView* view, const PuglEvent* event)
int
main(int argc, char** argv)
{
- static const int minSize = 256;
- static const int defaultSize = 512;
- static const int maxSize = 1024;
+ static const PuglSpan minSize = 256;
+ static const PuglSpan defaultSize = 512;
+ static const PuglSpan maxSize = 1024;
PuglTest test = {puglNewWorld(PUGL_PROGRAM, 0),
NULL,
@@ -87,10 +87,11 @@ main(int argc, char** argv)
puglSetHandle(test.view, &test);
puglSetEventFunc(test.view, onEvent);
puglSetViewHint(test.view, PUGL_RESIZABLE, PUGL_TRUE);
- puglSetMinSize(test.view, minSize, minSize);
- puglSetDefaultSize(test.view, defaultSize, defaultSize);
- puglSetMaxSize(test.view, maxSize, maxSize);
- puglSetAspectRatio(test.view, 1, 1, 1, 1);
+ puglSetSizeHint(test.view, PUGL_DEFAULT_SIZE, defaultSize, defaultSize);
+ puglSetSizeHint(test.view, PUGL_MIN_SIZE, minSize, minSize);
+ puglSetSizeHint(test.view, PUGL_MAX_SIZE, maxSize, maxSize);
+ puglSetSizeHint(test.view, PUGL_MIN_ASPECT, 1, 1);
+ puglSetSizeHint(test.view, PUGL_MAX_ASPECT, 1, 1);
// Create and show window
assert(!puglRealize(test.view));