diff options
Diffstat (limited to 'test/test_redisplay.c')
-rw-r--r-- | test/test_redisplay.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/test_redisplay.c b/test/test_redisplay.c index 4470053..6ec5bb8 100644 --- a/test/test_redisplay.c +++ b/test/test_redisplay.c @@ -31,6 +31,12 @@ #include <stddef.h> #include <stdint.h> +#ifdef __APPLE__ +static const double timeout = 1 / 60.0; +#else +static const double timeout = -1.0; +#endif + typedef enum { START, EXPOSED, @@ -85,13 +91,6 @@ onEvent(PuglView* view, const PuglEvent* event) return PUGL_SUCCESS; } -static void -tick(PuglWorld* world) -{ - assert(!puglPollEvents(world, -1)); - assert(!puglDispatchEvents(world)); -} - int main(int argc, char** argv) { @@ -111,7 +110,7 @@ main(int argc, char** argv) assert(!puglCreateWindow(app.view, "Pugl Test")); assert(!puglShowWindow(app.view)); while (app.state != EXPOSED) { - tick(app.world); + assert(!puglUpdate(app.world, timeout)); } // Send a custom event to trigger a redisplay in the event loop @@ -121,7 +120,7 @@ main(int argc, char** argv) // Loop until an expose happens in the same iteration as the redisplay app.state = SHOULD_REDISPLAY; while (app.state != REDISPLAYED) { - tick(app.world); + assert(!puglUpdate(app.world, timeout)); assert(app.state != POSTED_REDISPLAY); } |