Make some printf() calls into SDL_Log() so I can see them on Windows. :)
authorRyan C. Gordon <icculus@icculus.org>
Fri, 30 May 2014 01:48:08 -0400
changeset 8939 caaa7653f02b
parent 8938 c73bac338b90
child 8940 850e149d02d8
Make some printf() calls into SDL_Log() so I can see them on Windows. :)
src/test/SDL_test_common.c
test/testhittesting.c
--- a/src/test/SDL_test_common.c	Thu May 29 13:39:02 2014 -0400
+++ b/src/test/SDL_test_common.c	Fri May 30 01:48:08 2014 -0400
@@ -1386,7 +1386,7 @@
                 if (current_win) {
                     const SDL_bool shouldCapture = (SDL_GetWindowFlags(current_win) & SDL_WINDOW_MOUSE_CAPTURE) == 0;
                     const int rc = SDL_CaptureMouse(shouldCapture);
-                    printf("%sapturing mouse %s!\n", shouldCapture ? "C" : "Unc", (rc == 0) ? "succeeded" : "failed");
+                    SDL_Log("%sapturing mouse %s!\n", shouldCapture ? "C" : "Unc", (rc == 0) ? "succeeded" : "failed");
                 }
             }
             break;
--- a/test/testhittesting.c	Thu May 29 13:39:02 2014 -0400
+++ b/test/testhittesting.c	Fri May 30 01:48:08 2014 -0400
@@ -18,12 +18,12 @@
     int i;
     for (i = 0; i < numareas; i++) {
         if (SDL_PointInRect(pt, &areas[i])) {
-            printf("HIT-TEST: DRAGGABLE\n");
+            SDL_Log("HIT-TEST: DRAGGABLE\n");
             return SDL_HITTEST_DRAGGABLE;
         }
     }
 
-    printf("HIT-TEST: NORMAL\n");
+    SDL_Log("HIT-TEST: NORMAL\n");
     return SDL_HITTEST_NORMAL;
 }
 
@@ -40,7 +40,7 @@
     renderer = SDL_CreateRenderer(window, -1, 0);
 
     if (SDL_SetWindowHitTest(window, hitTest, NULL) == -1) {
-        fprintf(stderr, "Enabling hit-testing failed!\n");
+        SDL_Log("Enabling hit-testing failed!\n");
         SDL_Quit();
         return 1;
     }
@@ -61,16 +61,16 @@
             switch (e.type)
             {
                 case SDL_MOUSEBUTTONDOWN:
-                    printf("button down!\n");
+                    SDL_Log("button down!\n");
                     break;
 
                 case SDL_MOUSEBUTTONUP:
-                    printf("button up!\n");
+                    SDL_Log("button up!\n");
                     break;
 
                 case SDL_WINDOWEVENT:
                     if (e.window.event == SDL_WINDOWEVENT_MOVED) {
-                        printf("Window event moved to (%d, %d)!\n", (int) e.window.data1, (int) e.window.data2);
+                        SDL_Log("Window event moved to (%d, %d)!\n", (int) e.window.data1, (int) e.window.data2);
                     }
                     break;