test/testgl2.c
changeset 3099 82e60908fab1
parent 2328 91e601d9df8b
child 3139 7f684f249ec9
     1.1 --- a/test/testgl2.c	Mon Mar 23 05:37:45 2009 +0000
     1.2 +++ b/test/testgl2.c	Tue Mar 24 10:33:12 2009 +0000
     1.3 @@ -168,6 +168,7 @@
     1.4      SDL_DisplayMode mode;
     1.5      SDL_Event event;
     1.6      Uint32 then, now, frames;
     1.7 +    int status;
     1.8  
     1.9      /* Initialize parameters */
    1.10      fsaa = 0;
    1.11 @@ -241,26 +242,52 @@
    1.12      printf("Extensions : %s\n", glGetString(GL_EXTENSIONS));
    1.13      printf("\n");
    1.14  
    1.15 -    SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
    1.16 -    printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
    1.17 -    SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value);
    1.18 -    printf("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value);
    1.19 -    SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value);
    1.20 -    printf("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value);
    1.21 -    SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value);
    1.22 -    printf("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", 16, value);
    1.23 -    SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &value);
    1.24 -    printf("SDL_GL_DOUBLEBUFFER: requested 1, got %d\n", value);
    1.25 +    status=SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
    1.26 +    if (!status) {
    1.27 +        printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
    1.28 +    } else {
    1.29 +        printf("Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError());
    1.30 +    }
    1.31 +    status=SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value);
    1.32 +    if (!status) {
    1.33 +        printf("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value);
    1.34 +    } else {
    1.35 +        printf("Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError());
    1.36 +    }
    1.37 +    status=SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value);
    1.38 +    if (!status) {
    1.39 +        printf("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value);
    1.40 +    } else {
    1.41 +        printf("Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError());
    1.42 +    }
    1.43 +    status=SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value);
    1.44 +    if (!status) {
    1.45 +        printf("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", 16, value);
    1.46 +    } else {
    1.47 +        printf("Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError());
    1.48 +    }
    1.49      if (fsaa) {
    1.50 -        SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value);
    1.51 -        printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
    1.52 -        SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value);
    1.53 -        printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
    1.54 -               value);
    1.55 +        status=SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value);
    1.56 +        if (!status) {
    1.57 +            printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
    1.58 +        } else {
    1.59 +            printf("Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", SDL_GetError());
    1.60 +        }
    1.61 +        status=SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value);
    1.62 +        if (!status) {
    1.63 +            printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, value);
    1.64 +        } else {
    1.65 +            printf("Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", SDL_GetError());
    1.66 +        }
    1.67      }
    1.68      if (accel) {
    1.69 -        SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.70 -        printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
    1.71 +        status=SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.72 +        if (!status)
    1.73 +        {
    1.74 +            printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
    1.75 +        } else {
    1.76 +            printf("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError());
    1.77 +        }
    1.78      }
    1.79  
    1.80      /* Set rendering settings */