src/events/SDL_mouse.c
changeset 8945 04248c700ada
parent 8944 045aac36daac
child 8952 4bb098814ec4
     1.1 --- a/src/events/SDL_mouse.c	Thu Jun 05 00:02:42 2014 -0400
     1.2 +++ b/src/events/SDL_mouse.c	Thu Jun 05 00:03:33 2014 -0400
     1.3 @@ -469,6 +469,30 @@
     1.4      return mouse->buttonstate;
     1.5  }
     1.6  
     1.7 +Uint32
     1.8 +SDL_GetAbsoluteMouseState(int *x, int *y)
     1.9 +{
    1.10 +    SDL_Mouse *mouse = SDL_GetMouse();
    1.11 +    int tmpx, tmpy;
    1.12 +
    1.13 +    /* make sure these are never NULL for the backend implementations... */
    1.14 +    if (!x) {
    1.15 +        x = &tmpx;
    1.16 +    }
    1.17 +    if (!y) {
    1.18 +        y = &tmpy;
    1.19 +    }
    1.20 +
    1.21 +    *x = *y = 0;
    1.22 +
    1.23 +    if (!mouse->GetAbsoluteMouseState) {
    1.24 +        SDL_assert(0 && "This should really be implemented for every target.");
    1.25 +        return 0;
    1.26 +    }
    1.27 +
    1.28 +    return mouse->GetAbsoluteMouseState(x, y);
    1.29 +}
    1.30 +
    1.31  void
    1.32  SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
    1.33  {