aboutsummaryrefslogtreecommitdiffstats
path: root/test/pugl_cairo_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-22 17:21:52 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:32:16 +0200
commitdacaaa5f328ac2598123aa1f0744ddd68c87e9cc (patch)
tree31bdcb5effdff7d84f946a577cd77d6462dd6083 /test/pugl_cairo_test.c
parent61476f5de49b20a6836186a82082bc2b7c70e971 (diff)
downloadpugl-dacaaa5f328ac2598123aa1f0744ddd68c87e9cc.tar.gz
pugl-dacaaa5f328ac2598123aa1f0744ddd68c87e9cc.tar.bz2
pugl-dacaaa5f328ac2598123aa1f0744ddd68c87e9cc.zip
Move puglGetTime() to PuglWorld
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);
}
}