From a522c769e3279861c45093edf6acfe1aafc1035f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Jun 2019 21:05:09 +0200 Subject: Add pugl_test options for FSAA and double-buffering --- pugl_test.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pugl_test.c b/pugl_test.c index dad1d9c..781a172 100644 --- a/pugl_test.c +++ b/pugl_test.c @@ -214,11 +214,19 @@ onEvent(PuglView* view, const PuglEvent* event) int main(int argc, char** argv) { + int samples = 0; + int doubleBuffer = PUGL_FALSE; bool ignoreKeyRepeat = false; bool resizable = false; for (int i = 1; i < argc; ++i) { - if (!strcmp(argv[i], "-h")) { + if (!strcmp(argv[i], "-a")) { + samples = 4; + } else if (!strcmp(argv[i], "-d")) { + doubleBuffer = PUGL_TRUE; + } else if (!strcmp(argv[i], "-h")) { printf("USAGE: %s [OPTIONS]...\n\n" + " -a Enable anti-aliasing\n" + " -d Enable double-buffering\n" " -h Display this help\n" " -i Ignore key repeat\n" " -r Resizable window\n", argv[0]); @@ -240,6 +248,9 @@ main(int argc, char** argv) puglInitWindowMinSize(view, 256, 256); puglInitResizable(view, resizable); + puglInitWindowHint(view, PUGL_SAMPLES, samples); + puglInitWindowHint(view, PUGL_DOUBLE_BUFFER, doubleBuffer); + puglIgnoreKeyRepeat(view, ignoreKeyRepeat); puglSetEventFunc(view, onEvent); -- cgit v1.2.1