diff test/testgl.c @ 3570:7812d3e9564e

OpenGL hardware acceleration defaults on
author Sam Lantinga <slouken@libsdl.org>
date Tue, 15 Dec 2009 20:36:31 +0000
parents 44e49d3fa6cf
children 19691cebb866
line wrap: on
line diff
--- a/test/testgl.c	Tue Dec 15 20:14:50 2009 +0000
+++ b/test/testgl.c	Tue Dec 15 20:36:31 2009 +0000
@@ -370,7 +370,7 @@
 int
 RunGLTest(int argc, char *argv[],
           int logo, int logocursor, int slowly, int bpp, float gamma,
-          int noframe, int fsaa, int sync, int accel)
+          int noframe, int fsaa, int sync, int noaccel)
 {
     int i;
     int rgb_size[3];
@@ -454,9 +454,7 @@
         SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
         SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa);
     }
-    if (accel) {
-        SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
-    }
+    SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, !noaccel);
     if (SDL_SetVideoMode(w, h, bpp, video_flags) == NULL) {
         fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
         SDL_Quit();
@@ -493,10 +491,8 @@
         printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
                value);
     }
-    if (accel) {
-        SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
-        printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
-    }
+    SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
+    printf("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", !noaccel, value);
     if (sync) {
         printf("Buffer swap interval: requested 1, got %d\n",
                SDL_GL_GetSwapInterval());
@@ -707,7 +703,7 @@
     float gamma = 0.0;
     int noframe = 0;
     int fsaa = 0;
-    int accel = 0;
+    int noaccel = 0;
     int sync = 0;
 
     logo = 0;
@@ -738,22 +734,22 @@
         if (strcmp(argv[i], "-fsaa") == 0) {
             ++fsaa;
         }
-        if (strcmp(argv[i], "-accel") == 0) {
-            ++accel;
+        if (strcmp(argv[i], "-noaccel") == 0) {
+            ++noaccel;
         }
         if (strcmp(argv[i], "-sync") == 0) {
             ++sync;
         }
         if (strncmp(argv[i], "-h", 2) == 0) {
             printf
-                ("Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-accel] [-sync] [-fullscreen]\n",
+                ("Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-noaccel] [-sync] [-fullscreen]\n",
                  argv[0]);
             exit(0);
         }
     }
     for (i = 0; i < numtests; ++i) {
         RunGLTest(argc, argv, logo, logocursor, slowly, bpp, gamma,
-                  noframe, fsaa, sync, accel);
+                  noframe, fsaa, sync, noaccel);
     }
     return 0;
 }