test/testgl2.c
changeset 6382 64d54101773a
parent 5535 96594ac5fd1a
child 6785 c094c438c0a6
equal deleted inserted replaced
6381:9da3d60cf531 6382:64d54101773a
   238         fprintf(stderr, "SDL_GL_CreateContext(): %s\n", SDL_GetError());
   238         fprintf(stderr, "SDL_GL_CreateContext(): %s\n", SDL_GetError());
   239         quit(2);
   239         quit(2);
   240     }
   240     }
   241 
   241 
   242     if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) {
   242     if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) {
   243         SDL_GL_SetSwapInterval(1);
   243         /* try late-swap-tearing first. If not supported, try normal vsync. */
   244     } else {
   244         if (SDL_GL_SetSwapInterval(-1) == -1) {
   245         SDL_GL_SetSwapInterval(0);
   245             SDL_GL_SetSwapInterval(1);
       
   246         }
       
   247     } else {
       
   248         SDL_GL_SetSwapInterval(0);  /* disable vsync. */
   246     }
   249     }
   247 
   250 
   248     SDL_GetCurrentDisplayMode(0, &mode);
   251     SDL_GetCurrentDisplayMode(0, &mode);
   249     printf("Screen BPP: %d\n", SDL_BITSPERPIXEL(mode.format));
   252     printf("Screen BPP    : %d\n", SDL_BITSPERPIXEL(mode.format));
       
   253     printf("Swap Interval : %d\n", SDL_GL_GetSwapInterval());
   250     printf("\n");
   254     printf("\n");
   251     printf("Vendor     : %s\n", glGetString(GL_VENDOR));
   255     printf("Vendor        : %s\n", glGetString(GL_VENDOR));
   252     printf("Renderer   : %s\n", glGetString(GL_RENDERER));
   256     printf("Renderer      : %s\n", glGetString(GL_RENDERER));
   253     printf("Version    : %s\n", glGetString(GL_VERSION));
   257     printf("Version       : %s\n", glGetString(GL_VERSION));
   254     printf("Extensions : %s\n", glGetString(GL_EXTENSIONS));
       
   255     printf("\n");
   258     printf("\n");
   256 
   259 
   257     status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
   260     status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
   258     if (!status) {
   261     if (!status) {
   259         printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
   262         printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);