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_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_cpp_demo.cpp')
-rw-r--r-- | examples/pugl_cpp_demo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/pugl_cpp_demo.cpp b/examples/pugl_cpp_demo.cpp index 7794529..015e7aa 100644 --- a/examples/pugl_cpp_demo.cpp +++ b/examples/pugl_cpp_demo.cpp @@ -115,10 +115,11 @@ main(int argc, char** argv) world.setClassName("PuglCppDemo"); view.setWindowTitle("Pugl C++ Demo"); - view.setDefaultSize(512, 512); - view.setMinSize(64, 64); - view.setMaxSize(256, 256); - view.setAspectRatio(1, 1, 16, 9); + view.setSizeHint(pugl::SizeHint::defaultSize, 512, 512); + view.setSizeHint(pugl::SizeHint::minSize, 64, 64); + view.setSizeHint(pugl::SizeHint::maxSize, 1024, 1024); + view.setSizeHint(pugl::SizeHint::minAspect, 1, 1); + view.setSizeHint(pugl::SizeHint::maxAspect, 16, 9); view.setBackend(pugl::glBackend()); view.setHint(pugl::ViewHint::resizable, opts.resizable); view.setHint(pugl::ViewHint::samples, opts.samples); |