test/testshape.c
changeset 7639 9406b7dd2f2d
parent 7517 965d57022c01
child 7663 53fe1b64eb2d
     1.1 --- a/test/testshape.c	Mon Aug 12 22:00:21 2013 -0700
     1.2 +++ b/test/testshape.c	Wed Aug 14 23:30:10 2013 -0700
     1.3 @@ -68,13 +68,16 @@
     1.4      int access = 0;
     1.5      SDL_Rect texture_dimensions;;
     1.6  
     1.7 +    /* Enable standard application logging */
     1.8 +    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
     1.9 +
    1.10      if(argc < 2) {
    1.11 -        printf("SDL_Shape requires at least one bitmap file as argument.\n");
    1.12 +		SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Shape requires at least one bitmap file as argument.");
    1.13          exit(-1);
    1.14      }
    1.15  
    1.16      if(SDL_VideoInit(NULL) == -1) {
    1.17 -        printf("Could not initialize SDL video.\n");
    1.18 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not initialize SDL video.");
    1.19          exit(-2);
    1.20      }
    1.21  
    1.22 @@ -91,7 +94,7 @@
    1.23                      SDL_FreeSurface(pictures[j].surface);
    1.24              SDL_free(pictures);
    1.25              SDL_VideoQuit();
    1.26 -            printf("Could not load surface from named bitmap file.\n");
    1.27 +            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not load surface from named bitmap file.");
    1.28              exit(-3);
    1.29          }
    1.30  
    1.31 @@ -112,7 +115,7 @@
    1.32              SDL_FreeSurface(pictures[i].surface);
    1.33          SDL_free(pictures);
    1.34          SDL_VideoQuit();
    1.35 -        printf("Could not create shaped window for SDL_Shape.\n");
    1.36 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create shaped window for SDL_Shape.");
    1.37          exit(-4);
    1.38      }
    1.39      renderer = SDL_CreateRenderer(window,-1,0);
    1.40 @@ -122,7 +125,7 @@
    1.41              SDL_FreeSurface(pictures[i].surface);
    1.42          SDL_free(pictures);
    1.43          SDL_VideoQuit();
    1.44 -        printf("Could not create rendering context for SDL_Shape window.\n");
    1.45 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create rendering context for SDL_Shape window.");
    1.46          exit(-5);
    1.47      }
    1.48  
    1.49 @@ -141,7 +144,7 @@
    1.50              SDL_DestroyRenderer(renderer);
    1.51              SDL_DestroyWindow(window);
    1.52              SDL_VideoQuit();
    1.53 -            printf("Could not create texture for SDL_shape.\n");
    1.54 +            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create texture for SDL_shape.");
    1.55              exit(-6);
    1.56          }
    1.57      }