diff options
author | David Robillard <d@drobilla.net> | 2020-03-08 17:47:16 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-08 18:06:52 +0100 |
commit | 6d099f40f04e4fb5594d53e10f57a6bd541ee568 (patch) | |
tree | 34e8d937dd29b01e41a96e38d8205a3cf0edf35e /examples/pugl_embed_demo.c | |
parent | 872ffe22fa5d915dfa16cf96db260882d0fd3247 (diff) | |
download | pugl-6d099f40f04e4fb5594d53e10f57a6bd541ee568.tar.gz pugl-6d099f40f04e4fb5594d53e10f57a6bd541ee568.tar.bz2 pugl-6d099f40f04e4fb5594d53e10f57a6bd541ee568.zip |
Embed Demo: Only redisplay on input when not running continuously
Diffstat (limited to 'examples/pugl_embed_demo.c')
-rw-r--r-- | examples/pugl_embed_demo.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/examples/pugl_embed_demo.c b/examples/pugl_embed_demo.c index f222773..3907801 100644 --- a/examples/pugl_embed_demo.c +++ b/examples/pugl_embed_demo.c @@ -102,8 +102,10 @@ swapFocus(PuglTestApp* app) puglGrabFocus(app->parent); } - puglPostRedisplay(app->parent); - puglPostRedisplay(app->child); + if (!app->continuous) { + puglPostRedisplay(app->parent); + puglPostRedisplay(app->child); + } } static void @@ -224,12 +226,16 @@ onEvent(PuglView* view, const PuglEvent* event) app->yAngle += event->motion.y - app->lastMouseY; app->lastMouseX = event->motion.x; app->lastMouseY = event->motion.y; - puglPostRedisplay(view); - puglPostRedisplay(app->parent); + if (!app->continuous) { + puglPostRedisplay(view); + puglPostRedisplay(app->parent); + } break; case PUGL_SCROLL: app->dist = fmaxf(10.0f, app->dist + (float)event->scroll.dy); - puglPostRedisplay(view); + if (!app->continuous) { + puglPostRedisplay(view); + } break; case PUGL_ENTER_NOTIFY: app->mouseEntered = true; |