diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index fdb68f040..855e97b08 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -100,7 +100,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); * * \sa SDL_GetMouseState */ -extern DECLSPEC Uint32 SDLCALL SDL_GetAbsoluteMouseState(int *x, int *y); +extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); /** * \brief Retrieve the relative state of the mouse. diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index aa996399e..668cf8d3d 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -581,4 +581,4 @@ #define SDL_WinRTRunApp SDL_WinRTRunApp_REAL #define SDL_CaptureMouse SDL_CaptureMouse_REAL #define SDL_SetWindowHitTest SDL_SetWindowHitTest_REAL -#define SDL_GetAbsoluteMouseState SDL_GetAbsoluteMouseState_REAL +#define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1df122257..eb820bf25 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -614,4 +614,4 @@ SDL_DYNAPI_PROC(int,SDL_WinRTRunApp,(int a, char **b, void *c),(a,b,c),return) #endif SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(Uint32,SDL_GetAbsoluteMouseState,(int *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(Uint32,SDL_GetGlobalMouseState,(int *a, int *b),(a,b),return) diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 970cc78c1..4ebfcca94 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -470,7 +470,7 @@ SDL_GetRelativeMouseState(int *x, int *y) } Uint32 -SDL_GetAbsoluteMouseState(int *x, int *y) +SDL_GetGlobalMouseState(int *x, int *y) { SDL_Mouse *mouse = SDL_GetMouse(); int tmpx, tmpy; @@ -485,12 +485,12 @@ SDL_GetAbsoluteMouseState(int *x, int *y) *x = *y = 0; - if (!mouse->GetAbsoluteMouseState) { + if (!mouse->GetGlobalMouseState) { SDL_assert(0 && "This should really be implemented for every target."); return 0; } - return mouse->GetAbsoluteMouseState(x, y); + return mouse->GetGlobalMouseState(x, y); } void diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 70b3ec0b3..61553d44f 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -67,7 +67,7 @@ typedef struct int (*CaptureMouse) (SDL_Window * window); /* Get absolute mouse coordinates. (x) and (y) are never NULL and set to zero before call. */ - Uint32 (*GetAbsoluteMouseState) (int *x, int *y); + Uint32 (*GetGlobalMouseState) (int *x, int *y); /* Data common to all mice */ SDL_MouseID mouseID; diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index fa6c1fea9..d05c60938 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1492,7 +1492,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) if (withControl) { /* Ctrl-A reports absolute mouse position. */ int x, y; - const Uint32 mask = SDL_GetAbsoluteMouseState(&x, &y); + const Uint32 mask = SDL_GetGlobalMouseState(&x, &y); SDL_Log("ABSOLUTE MOUSE: (%d, %d)%s%s%s%s%s\n", x, y, (mask & SDL_BUTTON_LMASK) ? " [LBUTTON]" : "", (mask & SDL_BUTTON_MMASK) ? " [MBUTTON]" : "", diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index c14f22637..dbd26aee8 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -283,7 +283,7 @@ Cocoa_CaptureMouse(SDL_Window *window) } static Uint32 -Cocoa_GetAbsoluteMouseState(int *x, int *y) +Cocoa_GetGlobalMouseState(int *x, int *y) { const NSUInteger cocoaButtons = [NSEvent pressedMouseButtons]; const NSPoint cocoaLocation = [NSEvent mouseLocation]; @@ -321,7 +321,7 @@ Cocoa_InitMouse(_THIS) mouse->WarpMouse = Cocoa_WarpMouse; mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode; mouse->CaptureMouse = Cocoa_CaptureMouse; - mouse->GetAbsoluteMouseState = Cocoa_GetAbsoluteMouseState; + mouse->GetGlobalMouseState = Cocoa_GetGlobalMouseState; SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor()); diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 8bb4106e2..1e5b8bd4a 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -261,7 +261,7 @@ WIN_CaptureMouse(SDL_Window *window) } static Uint32 -WIN_GetAbsoluteMouseState(int *x, int *y) +WIN_GetGlobalMouseState(int *x, int *y) { Uint32 retval = 0; POINT pt = { 0, 0 }; @@ -290,7 +290,7 @@ WIN_InitMouse(_THIS) mouse->WarpMouse = WIN_WarpMouse; mouse->SetRelativeMouseMode = WIN_SetRelativeMouseMode; mouse->CaptureMouse = WIN_CaptureMouse; - mouse->GetAbsoluteMouseState = WIN_GetAbsoluteMouseState; + mouse->GetGlobalMouseState = WIN_GetGlobalMouseState; SDL_SetDefaultCursor(WIN_CreateDefaultCursor()); diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 7386da5fb..16894d670 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -354,7 +354,7 @@ X11_CaptureMouse(SDL_Window *window) } static Uint32 -X11_GetAbsoluteMouseState(int *x, int *y) +X11_GetGlobalMouseState(int *x, int *y) { Display *display = GetDisplay(); const int num_screens = SDL_GetNumVideoDisplays(); @@ -398,7 +398,7 @@ X11_InitMouse(_THIS) mouse->WarpMouse = X11_WarpMouse; mouse->SetRelativeMouseMode = X11_SetRelativeMouseMode; mouse->CaptureMouse = X11_CaptureMouse; - mouse->GetAbsoluteMouseState = X11_GetAbsoluteMouseState; + mouse->GetGlobalMouseState = X11_GetGlobalMouseState; SDL_SetDefaultCursor(X11_CreateDefaultCursor()); }