aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);