diff options
author | David Robillard <d@drobilla.net> | 2016-09-20 08:55:40 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-20 08:55:40 -0400 |
commit | 3e4fc9bacab4e87ac78a331f942c7f9fbd4b3ede (patch) | |
tree | dd9bdf0aae4d549fd7acb0c7f636a15da8043c4f | |
parent | 3fbd9e6cf291387f50a580de8bb1195dac3b1143 (diff) | |
download | pugl-3e4fc9bacab4e87ac78a331f942c7f9fbd4b3ede.tar.gz pugl-3e4fc9bacab4e87ac78a331f942c7f9fbd4b3ede.tar.bz2 pugl-3e4fc9bacab4e87ac78a331f942c7f9fbd4b3ede.zip |
Add GL option to pugl_cairo_test
-rw-r--r-- | pugl_cairo_test.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pugl_cairo_test.c b/pugl_cairo_test.c index ccffab5..c04c785 100644 --- a/pugl_cairo_test.c +++ b/pugl_cairo_test.c @@ -162,15 +162,19 @@ onEvent(PuglView* view, const PuglEvent* event) int main(int argc, char** argv) { + bool useGL = false; bool ignoreKeyRepeat = false; bool resizable = false; for (int i = 1; i < argc; ++i) { if (!strcmp(argv[i], "-h")) { printf("USAGE: %s [OPTIONS]...\n\n" + " -g Use OpenGL\n" " -h Display this help\n" " -i Ignore key repeat\n" " -r Resizable window\n", argv[0]); return 0; + } else if (!strcmp(argv[i], "-g")) { + useGL = true; } else if (!strcmp(argv[i], "-i")) { ignoreKeyRepeat = true; } else if (!strcmp(argv[i], "-r")) { @@ -183,7 +187,7 @@ main(int argc, char** argv) PuglView* view = puglInit(NULL, NULL); puglInitWindowSize(view, 512, 512); puglInitResizable(view, resizable); - puglInitContextType(view, PUGL_CAIRO); + puglInitContextType(view, useGL ? PUGL_CAIRO_GL : PUGL_CAIRO); puglIgnoreKeyRepeat(view, ignoreKeyRepeat); puglSetEventFunc(view, onEvent); |