From 6d099f40f04e4fb5594d53e10f57a6bd541ee568 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Mar 2020 17:47:16 +0100 Subject: Embed Demo: Only redisplay on input when not running continuously --- examples/pugl_embed_demo.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'examples') 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; -- cgit v1.2.1