test/testgles.c
changeset 3099 82e60908fab1
parent 2765 f55c87ae336b
child 3110 e6c21c14ce3a
     1.1 --- a/test/testgles.c	Mon Mar 23 05:37:45 2009 +0000
     1.2 +++ b/test/testgles.c	Tue Mar 24 10:33:12 2009 +0000
     1.3 @@ -88,6 +88,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 @@ -160,24 +161,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 +    status=SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
    1.24 +    if (!status) {
    1.25 +        printf("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
    1.26 +    } else {
    1.27 +        printf("Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError());
    1.28 +    }
    1.29 +    status=SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value);
    1.30 +    if (!status) {
    1.31 +        printf("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value);
    1.32 +    } else {
    1.33 +        printf("Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError());
    1.34 +    }
    1.35 +    status=SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value);
    1.36 +    if (!status) {
    1.37 +        printf("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value);
    1.38 +    } else {
    1.39 +        printf("Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError());
    1.40 +    }
    1.41 +    status=SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value);
    1.42 +    if (!status) {
    1.43 +        printf("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", 16, value);
    1.44 +    } else {
    1.45 +        printf("Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError());
    1.46 +    }
    1.47      if (fsaa) {
    1.48 -        SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value);
    1.49 -        printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
    1.50 -        SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value);
    1.51 -        printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
    1.52 -               value);
    1.53 +        status=SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value);
    1.54 +        if (!status) {
    1.55 +            printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
    1.56 +        } else {
    1.57 +            printf("Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", SDL_GetError());
    1.58 +        }
    1.59 +        status=SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value);
    1.60 +        if (!status) {
    1.61 +            printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, value);
    1.62 +        } else {
    1.63 +            printf("Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", SDL_GetError());
    1.64 +        }
    1.65      }
    1.66      if (accel) {
    1.67 -        SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.68 -        printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
    1.69 +        status=SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
    1.70 +        if (!status)
    1.71 +        {
    1.72 +            printf("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
    1.73 +        } else {
    1.74 +            printf("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError());
    1.75 +        }
    1.76      }
    1.77  
    1.78      /* Set rendering settings */