mirror of https://github.com/encounter/SDL.git
Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState().
This matches naming conventions in the main repository, between SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
This commit is contained in:
parent
2cce7b2ed3
commit
8436956711
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]" : "",
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue