diff options
author | David Robillard <d@drobilla.net> | 2019-10-27 12:47:56 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-11-03 20:52:32 +0100 |
commit | 84754fdb2ff35779378e032ec2f195a22d66fe30 (patch) | |
tree | b591fbdd002c4d7cff6726429807f6fa2e1e4345 /test/pugl_test.c | |
parent | a96511e36737284589361616f4fb4c0874095da7 (diff) | |
download | pugl-84754fdb2ff35779378e032ec2f195a22d66fe30.tar.gz pugl-84754fdb2ff35779378e032ec2f195a22d66fe30.tar.bz2 pugl-84754fdb2ff35779378e032ec2f195a22d66fe30.zip |
Add verbose option to test programs to print all events
Diffstat (limited to 'test/pugl_test.c')
-rw-r--r-- | test/pugl_test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/pugl_test.c b/test/pugl_test.c index 4bd5f80..7033d45 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -49,6 +49,7 @@ typedef struct double lastDrawTime; unsigned framesDrawn; bool mouseEntered; + bool verbose; } PuglTestApp; static PuglRect @@ -199,7 +200,7 @@ onParentEvent(PuglView* view, const PuglEvent* event) PuglTestApp* app = (PuglTestApp*)puglGetHandle(view); const PuglRect parentFrame = puglGetFrame(view); - printEvent(event, "Parent: "); + printEvent(event, "Parent: ", app->verbose); switch (event->type) { case PUGL_CONFIGURE: @@ -247,7 +248,7 @@ onEvent(PuglView* view, const PuglEvent* event) { PuglTestApp* app = (PuglTestApp*)puglGetHandle(view); - printEvent(event, "Child: "); + printEvent(event, "Child: ", app->verbose); switch (event->type) { case PUGL_CONFIGURE: @@ -260,7 +261,7 @@ onEvent(PuglView* view, const PuglEvent* event) app->quit = 1; break; case PUGL_KEY_PRESS: - onKeyPress(view, &event->key, "Child: "); + onKeyPress(view, &event->key, "Child: "); break; case PUGL_MOTION_NOTIFY: app->xAngle = fmodf(app->xAngle - (float)(event->motion.x - app->lastMouseX), 360.0f); @@ -300,6 +301,7 @@ main(int argc, char** argv) } app.continuous = opts.continuous; + app.verbose = opts.verbose; app.world = puglNewWorld(); app.parent = puglNewView(app.world); |