aboutsummaryrefslogtreecommitdiffstats
path: root/pugl_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-06-27 21:05:09 +0200
committerDavid Robillard <d@drobilla.net>2019-06-27 22:08:23 +0200
commita522c769e3279861c45093edf6acfe1aafc1035f (patch)
tree9ad6d51e9bd1f0fca81df19cac5b11b66db50bd1 /pugl_test.c
parent2c19c0b4944b6f277f063f33dfe075cc57e7f7c0 (diff)
downloadpugl-a522c769e3279861c45093edf6acfe1aafc1035f.tar.gz
pugl-a522c769e3279861c45093edf6acfe1aafc1035f.tar.bz2
pugl-a522c769e3279861c45093edf6acfe1aafc1035f.zip
Add pugl_test options for FSAA and double-buffering
Diffstat (limited to 'pugl_test.c')
-rw-r--r--pugl_test.c13
1 files changed, 12 insertions, 1 deletions
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);