test/testrendercopyex.c
changeset 7639 9406b7dd2f2d
parent 7517 965d57022c01
child 7663 53fe1b64eb2d
     1.1 --- a/test/testrendercopyex.c	Mon Aug 12 22:00:21 2013 -0700
     1.2 +++ b/test/testrendercopyex.c	Wed Aug 14 23:30:10 2013 -0700
     1.3 @@ -46,7 +46,7 @@
     1.4      /* Load the sprite image */
     1.5      temp = SDL_LoadBMP(file);
     1.6      if (temp == NULL) {
     1.7 -        fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
     1.8 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
     1.9          return NULL;
    1.10      }
    1.11  
    1.12 @@ -77,7 +77,7 @@
    1.13      /* Create textures from the image */
    1.14      texture = SDL_CreateTextureFromSurface(renderer, temp);
    1.15      if (!texture) {
    1.16 -        fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
    1.17 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
    1.18          SDL_FreeSurface(temp);
    1.19          return NULL;
    1.20      }
    1.21 @@ -139,6 +139,9 @@
    1.22      int frames;
    1.23      Uint32 then, now;
    1.24  
    1.25 +	/* Enable standard application logging */
    1.26 +    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
    1.27 +
    1.28      /* Initialize test framework */
    1.29      state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
    1.30      if (!state) {
    1.31 @@ -149,7 +152,7 @@
    1.32  
    1.33          consumed = SDLTest_CommonArg(state, i);
    1.34          if (consumed == 0) {
    1.35 -            fprintf(stderr, "Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
    1.36 +            SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
    1.37              return 1;
    1.38          }
    1.39          i += consumed;
    1.40 @@ -193,7 +196,7 @@
    1.41      now = SDL_GetTicks();
    1.42      if (now > then) {
    1.43          double fps = ((double) frames * 1000) / (now - then);
    1.44 -        printf("%2.2f frames per second\n", fps);
    1.45 +        SDL_Log("%2.2f frames per second\n", fps);
    1.46      }
    1.47  
    1.48      SDL_stack_free(drawstates);