SDL_CaptureMouse() is available since SDL 2.0.4.
This commit is contained in:
parent
bf16f3fe7d
commit
96c6ce2221
10
src/input.c
10
src/input.c
@ -1318,9 +1318,10 @@ int Get_input(int sleep_time)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
#ifdef USE_SDL2
|
#if defined(USE_SDL2) && SDL_VERSION_ATLEAST(2, 0, 4)
|
||||||
|
// SDL_CaptureMouse() is available since SDL 2.0.4.
|
||||||
SDL_CaptureMouse(SDL_TRUE);
|
SDL_CaptureMouse(SDL_TRUE);
|
||||||
#else
|
#elif defined(USE_SDL)
|
||||||
SDL_WM_GrabInput(SDL_GRAB_ON);
|
SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||||
#endif
|
#endif
|
||||||
Handle_mouse_click(&event.button);
|
Handle_mouse_click(&event.button);
|
||||||
@ -1328,9 +1329,10 @@ int Get_input(int sleep_time)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
#ifdef USE_SDL2
|
#if defined(USE_SDL2) && SDL_VERSION_ATLEAST(2, 0, 4)
|
||||||
|
// SDL_CaptureMouse() is available since SDL 2.0.4.
|
||||||
SDL_CaptureMouse(SDL_FALSE);
|
SDL_CaptureMouse(SDL_FALSE);
|
||||||
#else
|
#elif defined(USE_SDL)
|
||||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||||
#endif
|
#endif
|
||||||
Handle_mouse_release(&event.button);
|
Handle_mouse_release(&event.button);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user