test/testgesture.c
changeset 5458 a96fcc853bef
parent 5457 e4ee8761f5cd
child 5460 43582fccdc0d
     1.1 --- a/test/testgesture.c	Wed Mar 09 14:47:37 2011 -0800
     1.2 +++ b/test/testgesture.c	Wed Mar 09 15:08:41 2011 -0800
     1.3 @@ -11,7 +11,6 @@
     1.4  #include "SDL_touch.h"
     1.5  #include "SDL_gesture.h"
     1.6  
     1.7 -
     1.8  /* Make sure we have good macros for printing 32 and 64 bit values */
     1.9  #ifndef PRIs32
    1.10  #define PRIs32 "d"
    1.11 @@ -43,7 +42,7 @@
    1.12  #define EVENT_BUF_SIZE 256
    1.13  
    1.14  
    1.15 -#define VERBOSE SDL_FALSE
    1.16 +#define VERBOSE 0
    1.17  
    1.18  static SDL_Window *window;
    1.19  static SDL_Event events[EVENT_BUF_SIZE];
    1.20 @@ -65,7 +64,7 @@
    1.21  
    1.22  void handler (int sig)
    1.23  {
    1.24 -  printf ("exiting...(%d)\n", sig);
    1.25 +  SDL_Log ("exiting...(%d)\n", sig);
    1.26    exit (0);
    1.27  }
    1.28  
    1.29 @@ -234,12 +233,12 @@
    1.30  		break;
    1.31  	      case SDLK_s:
    1.32  		src = SDL_RWFromFile("gestureSave","w");
    1.33 -		printf("Wrote %i templates\n",SDL_SaveAllDollarTemplates(src));
    1.34 +		SDL_Log("Wrote %i templates\n",SDL_SaveAllDollarTemplates(src));
    1.35  		SDL_RWclose(src);
    1.36  		break;
    1.37  	      case SDLK_l:
    1.38  		src = SDL_RWFromFile("gestureSave","r");
    1.39 -		printf("Loaded: %i\n",SDL_LoadDollarTemplates(-1,src));
    1.40 +		SDL_Log("Loaded: %i\n",SDL_LoadDollarTemplates(-1,src));
    1.41  		SDL_RWclose(src);
    1.42  		break;
    1.43  	      case SDLK_ESCAPE:
    1.44 @@ -258,7 +257,7 @@
    1.45  	    break;
    1.46  	  case SDL_FINGERMOTION:
    1.47  #if VERBOSE
    1.48 -	    printf("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId,
    1.49 +	    SDL_Log("Finger: %i,x: %i, y: %i\n",event.tfinger.fingerId,
    1.50  	    	   event.tfinger.x,event.tfinger.y);
    1.51  #endif
    1.52  		{
    1.53 @@ -268,24 +267,24 @@
    1.54  	    break;	    
    1.55  	  case SDL_FINGERDOWN:
    1.56  #if VERBOSE
    1.57 -	    printf("Finger: %"PRIs64" down - x: %i, y: %i\n",
    1.58 +	    SDL_Log("Finger: %"PRIs64" down - x: %i, y: %i\n",
    1.59  		   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
    1.60  #endif
    1.61  	    break;
    1.62  	  case SDL_FINGERUP:
    1.63  #if VERBOSE
    1.64 -	    printf("Finger: %"PRIs64" up - x: %i, y: %i\n",
    1.65 +	    SDL_Log("Finger: %"PRIs64" up - x: %i, y: %i\n",
    1.66  	    	   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
    1.67  #endif
    1.68  	    break;
    1.69  	  case SDL_MULTIGESTURE:
    1.70  #if VERBOSE	    
    1.71 -	    printf("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f\n",
    1.72 +	    SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f\n",
    1.73  		   event.mgesture.x,
    1.74  		   event.mgesture.y,
    1.75  		   event.mgesture.dTheta,
    1.76  		   event.mgesture.dDist);
    1.77 -	    printf("MG: numDownTouch = %i\n",event.mgesture.numFingers);
    1.78 +	    SDL_Log("MG: numDownTouch = %i\n",event.mgesture.numFingers);
    1.79  #endif
    1.80  	    knob.p.x = event.mgesture.x;
    1.81  	    knob.p.y = event.mgesture.y;
    1.82 @@ -293,12 +292,12 @@
    1.83  	    knob.r += event.mgesture.dDist;
    1.84  	    break;
    1.85  	  case SDL_DOLLARGESTURE:
    1.86 -	    printf("Gesture %"PRIs64" performed, error: %f\n",
    1.87 +	    SDL_Log("Gesture %"PRIs64" performed, error: %f\n",
    1.88  		   event.dgesture.gestureId,
    1.89  		   event.dgesture.error);
    1.90  	    break;
    1.91  	  case SDL_DOLLARRECORD:
    1.92 -	    printf("Recorded gesture: %"PRIs64"\n",event.dgesture.gestureId);
    1.93 +	    SDL_Log("Recorded gesture: %"PRIs64"\n",event.dgesture.gestureId);
    1.94  	    break;
    1.95  	  }
    1.96        }