aboutsummaryrefslogtreecommitdiffstats
path: root/test/pugl_cairo_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/pugl_cairo_test.c')
-rw-r--r--test/pugl_cairo_test.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c
index 3cdf904..7779069 100644
--- a/test/pugl_cairo_test.c
+++ b/test/pugl_cairo_test.c
@@ -30,6 +30,8 @@
#include <stdio.h>
#include <string.h>
+static PuglWorld* world = NULL;
+
static bool continuous = false;
static int quit = 0;
static bool entered = false;
@@ -130,7 +132,7 @@ onDisplay(PuglView* view)
// Draw button
for (Button* b = buttons; b->label; ++b) {
- buttonDraw(cr, b, continuous ? puglGetTime(view) : 0.0);
+ buttonDraw(cr, b, continuous ? puglGetTime(world) : 0.0);
}
++framesDrawn;
@@ -202,8 +204,9 @@ main(int argc, char** argv)
}
}
- PuglWorld* world = puglNewWorld();
- PuglView* view = puglNewView(world);
+ world = puglNewWorld();
+
+ PuglView* view = puglNewView(world);
puglInitWindowClass(view, "PuglCairoTest");
puglInitWindowSize(view, 512, 512);
puglInitWindowMinSize(view, 256, 256);
@@ -219,7 +222,7 @@ main(int argc, char** argv)
puglShowWindow(view);
- PuglFpsPrinter fpsPrinter = { puglGetTime(view) };
+ PuglFpsPrinter fpsPrinter = { puglGetTime(world) };
while (!quit) {
if (continuous) {
puglPostRedisplay(view);
@@ -230,7 +233,7 @@ main(int argc, char** argv)
puglProcessEvents(view);
if (continuous) {
- puglPrintFps(view, &fpsPrinter, &framesDrawn);
+ puglPrintFps(world, &fpsPrinter, &framesDrawn);
}
}