aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-05-16 21:18:02 +0200
committerDavid Robillard <d@drobilla.net>2020-05-16 21:18:02 +0200
commitfe96ed3c451548278197e2da74d3d53b1d6a8dd9 (patch)
tree6c4e3e751ddd13cd4898fac0fae4f4aed7079f36 /examples
parent3200cda25e06887e809fc5b47780aaf950253172 (diff)
Add default and maximum size
Diffstat (limited to 'examples')
-rw-r--r--examples/pugl_cairo_demo.c5
-rw-r--r--examples/pugl_cxx_demo.cpp2
-rw-r--r--examples/pugl_embed_demo.c2
-rw-r--r--examples/pugl_shader_demo.c8
-rw-r--r--examples/pugl_window_demo.c1
5 files changed, 8 insertions, 10 deletions
diff --git a/examples/pugl_cairo_demo.c b/examples/pugl_cairo_demo.c
index 51039a2..2e0b9c7 100644
--- a/examples/pugl_cairo_demo.c
+++ b/examples/pugl_cairo_demo.c
@@ -236,11 +236,10 @@ main(int argc, char** argv)
app.world = puglNewWorld(PUGL_PROGRAM, 0);
puglSetClassName(app.world, "PuglCairoTest");
- PuglRect frame = { 0, 0, 512, 512 };
- PuglView* view = puglNewView(app.world);
+ PuglView* view = puglNewView(app.world);
puglSetWindowTitle(view, "Pugl Cairo Demo");
- puglSetFrame(view, frame);
+ puglSetDefaultSize(view, 512, 512);
puglSetMinSize(view, 256, 256);
puglSetViewHint(view, PUGL_RESIZABLE, app.opts.resizable);
puglSetHandle(view, &app);
diff --git a/examples/pugl_cxx_demo.cpp b/examples/pugl_cxx_demo.cpp
index 9522534..4addee2 100644
--- a/examples/pugl_cxx_demo.cpp
+++ b/examples/pugl_cxx_demo.cpp
@@ -122,7 +122,7 @@ main(int argc, char** argv)
world.setClassName("PuglCppTest");
view.setWindowTitle("Pugl C++ Test");
- view.setFrame({0, 0, 512, 512});
+ view.setDefaultSize(512, 512);
view.setMinSize(64, 64);
view.setAspectRatio(1, 1, 16, 9);
view.setBackend(pugl::glBackend());
diff --git a/examples/pugl_embed_demo.c b/examples/pugl_embed_demo.c
index de7b240..bf7f19c 100644
--- a/examples/pugl_embed_demo.c
+++ b/examples/pugl_embed_demo.c
@@ -293,7 +293,7 @@ main(int argc, char** argv)
puglSetClassName(app.world, "Pugl Test");
const PuglRect parentFrame = { 0, 0, 512, 512 };
- puglSetFrame(app.parent, parentFrame);
+ puglSetDefaultSize(app.parent, 512, 512);
puglSetMinSize(app.parent, borderWidth * 3, borderWidth * 3);
puglSetAspectRatio(app.parent, 1, 1, 16, 9);
puglSetBackend(app.parent, puglGlBackend());
diff --git a/examples/pugl_shader_demo.c b/examples/pugl_shader_demo.c
index 86d01a9..7c0df6a 100644
--- a/examples/pugl_shader_demo.c
+++ b/examples/pugl_shader_demo.c
@@ -243,7 +243,7 @@ parseOptions(PuglTestApp* app, int argc, char** argv)
}
static void
-setupPugl(PuglTestApp* app, const PuglRect frame)
+setupPugl(PuglTestApp* app)
{
// Create world, view, and rect data
app->world = puglNewWorld(PUGL_PROGRAM, 0);
@@ -253,7 +253,7 @@ setupPugl(PuglTestApp* app, const PuglRect frame)
// Set up world and view
puglSetClassName(app->world, "PuglGL3Demo");
puglSetWindowTitle(app->view, "Pugl OpenGL 3");
- puglSetFrame(app->view, frame);
+ puglSetDefaultSize(app->view, defaultWidth, defaultHeight);
puglSetMinSize(app->view, defaultWidth / 4, defaultHeight / 4);
puglSetAspectRatio(app->view, 1, 1, 16, 9);
puglSetBackend(app->view, puglGlBackend());
@@ -389,8 +389,6 @@ main(int argc, char** argv)
app.glMajorVersion = 3;
app.glMinorVersion = 3;
- const PuglRect frame = {0, 0, defaultWidth, defaultHeight};
-
// Parse command line options
if (parseOptions(&app, argc, argv)) {
puglPrintTestUsage("pugl_shader_demo", "[NUM_RECTS] [GL_MAJOR]");
@@ -398,7 +396,7 @@ main(int argc, char** argv)
}
// Create and configure world and view
- setupPugl(&app, frame);
+ setupPugl(&app);
// Create window (which will send a PUGL_CREATE event)
const PuglStatus st = puglRealize(app.view);
diff --git a/examples/pugl_window_demo.c b/examples/pugl_window_demo.c
index 3b167af..b406416 100644
--- a/examples/pugl_window_demo.c
+++ b/examples/pugl_window_demo.c
@@ -213,6 +213,7 @@ main(int argc, char** argv)
puglSetWindowTitle(view, "Pugl Window Demo");
puglSetFrame(view, frame);
+ puglSetDefaultSize(view, 512, 512);
puglSetMinSize(view, 128, 128);
puglSetBackend(view, puglGlBackend());