include/SDL_mouse.h
changeset 8945 04248c700ada
parent 8927 be64f5daf64b
child 8952 4bb098814ec4
equal deleted inserted replaced
8944:045aac36daac 8945:04248c700ada
    76  *  selected mouse.  You can pass NULL for either x or y.
    76  *  selected mouse.  You can pass NULL for either x or y.
    77  */
    77  */
    78 extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
    78 extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
    79 
    79 
    80 /**
    80 /**
       
    81  *  \brief Get the current state of the mouse, in relation to the desktop
       
    82  *
       
    83  *  This works just like SDL_GetMouseState(), but the coordinates will be
       
    84  *  reported relative to the top-left of the desktop. This can be useful if
       
    85  *  you need to track the mouse outside of a specific window and
       
    86  *  SDL_CaptureMouse() doesn't fit your needs. For example, it could be
       
    87  *  useful if you need to track the mouse while dragging a window, where
       
    88  *  coordinates relative to a window might not be in sync at all times.
       
    89  *
       
    90  *  \note SDL_GetMouseState() returns the mouse position as SDL understands
       
    91  *        it from the last pump of the event queue. This function, however,
       
    92  *        queries the OS for the current mouse position, and as such, might
       
    93  *        be a slightly less efficient function. Unless you know what you're
       
    94  *        doing and have a good reason to use this function, you probably want
       
    95  *        SDL_GetMouseState() instead.
       
    96  *
       
    97  *  \param x Returns the current X coord, relative to the desktop. Can be NULL.
       
    98  *  \param y Returns the current Y coord, relative to the desktop. Can be NULL.
       
    99  *  \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
       
   100  *
       
   101  *  \sa SDL_GetMouseState
       
   102  */
       
   103 extern DECLSPEC Uint32 SDLCALL SDL_GetAbsoluteMouseState(int *x, int *y);
       
   104 
       
   105 /**
    81  *  \brief Retrieve the relative state of the mouse.
   106  *  \brief Retrieve the relative state of the mouse.
    82  *
   107  *
    83  *  The current button state is returned as a button bitmask, which can
   108  *  The current button state is returned as a button bitmask, which can
    84  *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
   109  *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
    85  *  mouse deltas since the last call to SDL_GetRelativeMouseState().
   110  *  mouse deltas since the last call to SDL_GetRelativeMouseState().