src/events/SDL_mouse.c
changeset 8945 04248c700ada
parent 8944 045aac36daac
child 8952 4bb098814ec4
equal deleted inserted replaced
8944:045aac36daac 8945:04248c700ada
   465         *y = mouse->ydelta;
   465         *y = mouse->ydelta;
   466     }
   466     }
   467     mouse->xdelta = 0;
   467     mouse->xdelta = 0;
   468     mouse->ydelta = 0;
   468     mouse->ydelta = 0;
   469     return mouse->buttonstate;
   469     return mouse->buttonstate;
       
   470 }
       
   471 
       
   472 Uint32
       
   473 SDL_GetAbsoluteMouseState(int *x, int *y)
       
   474 {
       
   475     SDL_Mouse *mouse = SDL_GetMouse();
       
   476     int tmpx, tmpy;
       
   477 
       
   478     /* make sure these are never NULL for the backend implementations... */
       
   479     if (!x) {
       
   480         x = &tmpx;
       
   481     }
       
   482     if (!y) {
       
   483         y = &tmpy;
       
   484     }
       
   485 
       
   486     *x = *y = 0;
       
   487 
       
   488     if (!mouse->GetAbsoluteMouseState) {
       
   489         SDL_assert(0 && "This should really be implemented for every target.");
       
   490         return 0;
       
   491     }
       
   492 
       
   493     return mouse->GetAbsoluteMouseState(x, y);
   470 }
   494 }
   471 
   495 
   472 void
   496 void
   473 SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
   497 SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
   474 {
   498 {