diff options
author | David Robillard <d@drobilla.net> | 2023-05-12 17:09:01 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-05-12 17:09:01 -0400 |
commit | 1f2bb7e20131395a30fc4ce55740de6984d56f10 (patch) | |
tree | ae575ffc5d7b94f6cb017dc5bdf2426ffca9eef3 | |
parent | 5dc502bc458d05e2a5823675ef3469a4181cd7a4 (diff) | |
download | pugl-1f2bb7e20131395a30fc4ce55740de6984d56f10.tar.gz pugl-1f2bb7e20131395a30fc4ce55740de6984d56f10.tar.bz2 pugl-1f2bb7e20131395a30fc4ce55740de6984d56f10.zip |
Make examples continuous by default
-rw-r--r-- | examples/pugl_vulkan_demo.c | 4 | ||||
-rw-r--r-- | test/test_utils.h | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/examples/pugl_vulkan_demo.c b/examples/pugl_vulkan_demo.c index 59e3060..2f9eaff 100644 --- a/examples/pugl_vulkan_demo.c +++ b/examples/pugl_vulkan_demo.c @@ -1,4 +1,4 @@ -// Copyright 2019-2020 David Robillard <d@drobilla.net> +// Copyright 2019-2023 David Robillard <d@drobilla.net> // Copyright 2019 Jordan Halase <jordan@halase.me> // SPDX-License-Identifier: ISC @@ -1008,6 +1008,8 @@ onEvent(PuglView* const view, const PuglEvent* const e) printEvent(e, "Event: ", app->opts.verbose); switch (e->type) { + case PUGL_UPDATE: + return app->opts.continuous ? puglPostRedisplay(view) : PUGL_SUCCESS; case PUGL_EXPOSE: return onExpose(view); case PUGL_CONFIGURE: diff --git a/test/test_utils.h b/test/test_utils.h index c1dfb9d..6e979db 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -1,4 +1,4 @@ -// Copyright 2012-2022 David Robillard <d@drobilla.net> +// Copyright 2012-2023 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC #ifndef TEST_TEST_UTILS_H @@ -322,7 +322,7 @@ puglPrintTestUsage(const char* prog, const char* posHelp) " -E Use OpenGL ES\n" " -G OpenGL context version\n" " -a Enable anti-aliasing\n" - " -c Continuously animate and draw\n" + " -b Block and only update on user input\n" " -d Directly draw to window (no double-buffering)\n" " -e Enable platform error-checking\n" " -f Fast drawing, explicitly disable vertical sync\n" @@ -345,7 +345,7 @@ puglParseTestOptions(int* pargc, char*** pargv) PUGL_OPENGL_API, 3, 3, - false, + true, false, false, false, @@ -372,8 +372,8 @@ puglParseTestOptions(int* pargc, char*** pargv) } } else if (!strcmp(argv[i], "-a")) { opts.samples = 4; - } else if (!strcmp(argv[i], "-c")) { - opts.continuous = true; + } else if (!strcmp(argv[i], "-b")) { + opts.continuous = false; } else if (!strcmp(argv[i], "-d")) { opts.doubleBuffer = PUGL_FALSE; } else if (!strcmp(argv[i], "-e")) { |