test/testintersections.c
changeset 7639 9406b7dd2f2d
parent 7517 965d57022c01
child 7787 e6f3e8fc96ea
     1.1 --- a/test/testintersections.c	Mon Aug 12 22:00:21 2013 -0700
     1.2 +++ b/test/testintersections.c	Wed Aug 14 23:30:10 2013 -0700
     1.3 @@ -84,7 +84,7 @@
     1.4      if ((x1 == x2) && (y1 == y2))
     1.5          return 0;
     1.6  
     1.7 -    printf("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2);
     1.8 +    SDL_Log("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2);
     1.9      lines[num_lines].x = x1;
    1.10      lines[num_lines].y = y1;
    1.11      lines[num_lines].w = x2;
    1.12 @@ -133,7 +133,7 @@
    1.13      if (y1 > y2)
    1.14          SWAP(int, y1, y2);
    1.15  
    1.16 -    printf("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2,
    1.17 +    SDL_Log("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2,
    1.18             x2 - x1, y2 - y1);
    1.19  
    1.20      rects[num_rects].x = x1;
    1.21 @@ -199,6 +199,9 @@
    1.22      SDL_Event event;
    1.23      Uint32 then, now, frames;
    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 parameters */
    1.29      num_objects = NUM_OBJECTS;
    1.30  
    1.31 @@ -241,8 +244,7 @@
    1.32              }
    1.33          }
    1.34          if (consumed < 0) {
    1.35 -            fprintf(stderr,
    1.36 -                    "Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
    1.37 +            SDL_Log("Usage: %s %s [--blend none|blend|add|mod] [--cyclecolor] [--cyclealpha]\n",
    1.38                      argv[0], SDLTest_CommonUsage(state));
    1.39              return 1;
    1.40          }
    1.41 @@ -327,7 +329,7 @@
    1.42      now = SDL_GetTicks();
    1.43      if (now > then) {
    1.44          double fps = ((double) frames * 1000) / (now - then);
    1.45 -        printf("%2.2f frames per second\n", fps);
    1.46 +        SDL_Log("%2.2f frames per second\n", fps);
    1.47      }
    1.48      return 0;
    1.49  }