test/testgesture.c
changeset 6951 7833f01322b3
parent 6790 475f0a544157
child 7191 75360622e65f
equal deleted inserted replaced
6950:1ddb72193079 6951:7833f01322b3
   165 	unsigned int c, col;
   165 	unsigned int c, col;
   166 
   166 
   167     if(event->type == SDL_FINGERMOTION || 
   167     if(event->type == SDL_FINGERMOTION || 
   168        event->type == SDL_FINGERDOWN ||
   168        event->type == SDL_FINGERDOWN ||
   169        event->type == SDL_FINGERUP) {
   169        event->type == SDL_FINGERUP) {
   170       SDL_Touch* inTouch = SDL_GetTouch(event->tfinger.touchId);
   170       x = event->tfinger.x;
   171       if(inTouch == NULL) continue;
   171       y = event->tfinger.y;
   172 
       
   173       x = ((float)event->tfinger.x)/inTouch->xres;
       
   174       y = ((float)event->tfinger.y)/inTouch->yres;      
       
   175       
   172       
   176       //draw the touch:      
   173       //draw the touch:      
   177       c = colors[event->tfinger.fingerId%7]; 
   174       c = colors[event->tfinger.fingerId%7]; 
   178       col = ((unsigned int)(c*(.1+.85))) | (unsigned int)(0xFF*age)<<24;
   175       col = ((unsigned int)(c*(.1+.85))) | (unsigned int)(0xFF*age)<<24;
   179 
   176 
   267 	  case SDL_FINGERMOTION:
   264 	  case SDL_FINGERMOTION:
   268 #if VERBOSE
   265 #if VERBOSE
   269 	    SDL_Log("Finger: %i,x: %i, y: %i",event.tfinger.fingerId,
   266 	    SDL_Log("Finger: %i,x: %i, y: %i",event.tfinger.fingerId,
   270 	    	   event.tfinger.x,event.tfinger.y);
   267 	    	   event.tfinger.x,event.tfinger.y);
   271 #endif
   268 #endif
   272 		{
       
   273 			SDL_Touch* inTouch = SDL_GetTouch(event.tfinger.touchId);
       
   274 			SDL_Finger* inFinger = SDL_GetFinger(inTouch,event.tfinger.fingerId);
       
   275 		}
       
   276 	    break;	    
   269 	    break;	    
   277 	  case SDL_FINGERDOWN:
   270 	  case SDL_FINGERDOWN:
   278 #if VERBOSE
   271 #if VERBOSE
   279 	    SDL_Log("Finger: %"PRIs64" down - x: %i, y: %i",
   272 	    SDL_Log("Finger: %"PRIs64" down - x: %i, y: %i",
   280 		   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
   273 		   event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);