test/testgl2.c
changeset 6382 64d54101773a
parent 5535 96594ac5fd1a
child 6785 c094c438c0a6
     1.1 --- a/test/testgl2.c	Tue Jul 31 16:55:09 2012 -0700
     1.2 +++ b/test/testgl2.c	Wed Aug 01 20:29:36 2012 -0400
     1.3 @@ -240,18 +240,21 @@
     1.4      }
     1.5  
     1.6      if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) {
     1.7 -        SDL_GL_SetSwapInterval(1);
     1.8 +        /* try late-swap-tearing first. If not supported, try normal vsync. */
     1.9 +        if (SDL_GL_SetSwapInterval(-1) == -1) {
    1.10 +            SDL_GL_SetSwapInterval(1);
    1.11 +        }
    1.12      } else {
    1.13 -        SDL_GL_SetSwapInterval(0);
    1.14 +        SDL_GL_SetSwapInterval(0);  /* disable vsync. */
    1.15      }
    1.16  
    1.17      SDL_GetCurrentDisplayMode(0, &mode);
    1.18 -    printf("Screen BPP: %d\n", SDL_BITSPERPIXEL(mode.format));
    1.19 +    printf("Screen BPP    : %d\n", SDL_BITSPERPIXEL(mode.format));
    1.20 +    printf("Swap Interval : %d\n", SDL_GL_GetSwapInterval());
    1.21      printf("\n");
    1.22 -    printf("Vendor     : %s\n", glGetString(GL_VENDOR));
    1.23 -    printf("Renderer   : %s\n", glGetString(GL_RENDERER));
    1.24 -    printf("Version    : %s\n", glGetString(GL_VERSION));
    1.25 -    printf("Extensions : %s\n", glGetString(GL_EXTENSIONS));
    1.26 +    printf("Vendor        : %s\n", glGetString(GL_VENDOR));
    1.27 +    printf("Renderer      : %s\n", glGetString(GL_RENDERER));
    1.28 +    printf("Version       : %s\n", glGetString(GL_VERSION));
    1.29      printf("\n");
    1.30  
    1.31      status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);