aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Halase <jordan@halase.me>2020-10-14 15:00:20 -0500
committerJordan Halase <jordan@halase.me>2020-10-14 15:00:20 -0500
commitfed1b5aa14b211bb2e098fe66fd01c00574eb28e (patch)
tree0f6464ee4a636a3745f78d68fc37324a445bf847
parentb42ae422fba2d9d8b8d9e15fdec29ae70b6ed51d (diff)
Fix missing default size in pugl_print_events
-rw-r--r--examples/pugl_print_events.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/pugl_print_events.c b/examples/pugl_print_events.c
index 08a4a86..f9786fe 100644
--- a/examples/pugl_print_events.c
+++ b/examples/pugl_print_events.c
@@ -27,6 +27,9 @@
#include <stdbool.h>
#include <stdio.h>
+static const int defaultWidth = 512;
+static const int defaultHeight = 512;
+
typedef struct
{
PuglWorld* world;
@@ -59,12 +62,14 @@ main(void)
puglSetClassName(app.world, "Pugl Print Events");
puglSetWindowTitle(app.view, "Pugl Event Printer");
+ puglSetDefaultSize(app.view, defaultWidth, defaultHeight);
puglSetBackend(app.view, puglStubBackend());
puglSetHandle(app.view, &app);
puglSetEventFunc(app.view, onEvent);
- if (puglRealize(app.view)) {
- return logError("Failed to create window\n");
+ PuglStatus st;
+ if ((st = puglRealize(app.view))) {
+ return logError("Failed to create window: %s\n", puglStrerror(st));
}
puglShowWindow(app.view);