table of contents
SDL_GetMouseState(3) | SDL3 FUNCTIONS | SDL_GetMouseState(3) |
NAME¶
SDL_GetMouseState - Query SDL's cache for the synchronous mouse button state and the window-relative SDL-cursor position.
HEADER FILE¶
Defined in SDL3/SDL_mouse.h
SYNOPSIS¶
#include "SDL3/SDL.h"
SDL_MouseButtonFlags SDL_GetMouseState(float *x, float *y);
DESCRIPTION¶
This function returns the cached synchronous state as SDL understands it from the last pump of the event queue.
To query the platform for immediate asynchronous state, use
SDL_GetGlobalMouseState .
Passing non-NULL pointers to x or y will write the destination with respective x or y coordinates relative to the focused window.
In Relative Mode, the SDL-cursor's position usually contradicts the platform-cursor's position as manually calculated from
SDL_GetGlobalMouseState () and
SDL_GetWindowPosition .
FUNCTION PARAMETERS¶
RETURN VALUE¶
( SDL_MouseButtonFlags ) Returns a 32-bit bitmask of the button state that can be bitwise-compared against the
SDL_BUTTON_MASK (X) macro.
THREAD SAFETY¶
This function should only be called on the main thread.
AVAILABILITY¶
This function is available since SDL 3.2.0.
SEE ALSO¶
•(3), SDL_GetGlobalMouseState(3), •(3), SDL_GetRelativeMouseState(3)
SDL 3.2.0 | Simple Directmedia Layer |