test/testgl2.c
changeset 3570 7812d3e9564e
parent 3418 fba883490f72
child 3571 19691cebb866
     1.1 --- a/test/testgl2.c	Tue Dec 15 20:14:50 2009 +0000
     1.2 +++ b/test/testgl2.c	Tue Dec 15 20:36:31 2009 +0000
     1.3 @@ -162,7 +162,7 @@
     1.4  int
     1.5  main(int argc, char *argv[])
     1.6  {
     1.7 -    int fsaa, accel;
     1.8 +    int fsaa, noaccel;
     1.9      int value;
    1.10      int i, done;
    1.11      SDL_DisplayMode mode;
    1.12 @@ -172,7 +172,7 @@
    1.13  
    1.14      /* Initialize parameters */
    1.15      fsaa = 0;
    1.16 -    accel = 0;
    1.17 +    noaccel = 0;
    1.18  
    1.19      /* Initialize test framework */
    1.20      state = CommonCreateState(argv, SDL_INIT_VIDEO);
    1.21 @@ -187,15 +187,15 @@
    1.22              if (SDL_strcasecmp(argv[i], "--fsaa") == 0) {
    1.23                  ++fsaa;
    1.24                  consumed = 1;
    1.25 -            } else if (SDL_strcasecmp(argv[i], "--accel") == 0) {
    1.26 -                ++accel;
    1.27 +            } else if (SDL_strcasecmp(argv[i], "--noaccel") == 0) {
    1.28 +                ++noaccel;
    1.29                  consumed = 1;
    1.30              } else {
    1.31                  consumed = -1;
    1.32              }
    1.33          }
    1.34          if (consumed < 0) {
    1.35 -            fprintf(stderr, "Usage: %s %s [--fsaa] [--accel]\n", argv[0],
    1.36 +            fprintf(stderr, "Usage: %s %s [--fsaa] [--noaccel]\n", argv[0],
    1.37                      CommonUsage(state));
    1.38              quit(1);
    1.39          }
    1.40 @@ -213,9 +213,7 @@
    1.41          state->gl_multisamplebuffers = 1;
    1.42          state->gl_multisamplesamples = fsaa;
    1.43      }
    1.44 -    if (accel) {
    1.45 -        state->gl_accelerated=1;
    1.46 -    }
    1.47 +    state->gl_accelerated = !noaccel;
    1.48  
    1.49      if (!CommonInit(state)) {
    1.50          quit(2);
    1.51 @@ -284,14 +282,13 @@
    1.52                     SDL_GetError());
    1.53          }
    1.54      }
    1.55 -    if (accel) {
    1.56 -        status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.57 -        if (!status) {
    1.58 -            printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
    1.59 -        } else {
    1.60 -            printf("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n",
    1.61 -                   SDL_GetError());
    1.62 -        }
    1.63 +    status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.64 +    if (!status) {
    1.65 +        printf("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", !noaccel,
    1.66 +               value);
    1.67 +    } else {
    1.68 +        printf("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n",
    1.69 +               SDL_GetError());
    1.70      }
    1.71  
    1.72      /* Set rendering settings */