diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-24 13:33:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:17 +0300 |
commit | 2652836af364935294a2c731de74502de530f9e6 (patch) | |
tree | 97a19407af17f2ad19d830a41e35b41771a5df27 /src/utils | |
parent | c63a2a04e47c361a7254b0749298de84a6f331fa (diff) | |
download | plus-2652836af364935294a2c731de74502de530f9e6.tar.gz plus-2652836af364935294a2c731de74502de530f9e6.tar.bz2 plus-2652836af364935294a2c731de74502de530f9e6.tar.xz plus-2652836af364935294a2c731de74502de530f9e6.zip |
fix "grab input" in SDL2.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/sdl2helper.cpp | 5 | ||||
-rw-r--r-- | src/utils/sdl2helper.h | 1 | ||||
-rw-r--r-- | src/utils/sdlhelper.cpp | 5 | ||||
-rw-r--r-- | src/utils/sdlhelper.h | 1 |
4 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp index 1ae8b087f..442d40990 100644 --- a/src/utils/sdl2helper.cpp +++ b/src/utils/sdl2helper.cpp @@ -47,4 +47,9 @@ void SDL::SetWindowIcon(SDL_Window *const window, SDL_Surface *const icon) SDL_SetWindowIcon(window, icon); } +void SDL::grabInput(SDL_Window *const window, const bool grab) +{ + SDL_SetWindowGrab(window, grab ? SDL_TRUE : SDL_FALSE); +} + #endif // USE_SDL2 diff --git a/src/utils/sdl2helper.h b/src/utils/sdl2helper.h index bf3c57f0c..956a63ff8 100644 --- a/src/utils/sdl2helper.h +++ b/src/utils/sdl2helper.h @@ -37,6 +37,7 @@ namespace SDL void SetWindowIcon(SDL_Window *const window, SDL_Surface *const icon); + void grabInput(SDL_Window *const window, const bool grab); } // namespace SDL #endif // USE_SDL2 diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp index 9d28f6c96..a470ce927 100644 --- a/src/utils/sdlhelper.cpp +++ b/src/utils/sdlhelper.cpp @@ -73,4 +73,9 @@ void SDL::SetWindowIcon(SDL_Surface *const window A_UNUSED, SDL_WM_SetIcon(icon, nullptr); } +void SDL::grabInput(SDL_Surface *const window A_UNUSED, const bool grab) +{ + SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF); +} + #endif // USE_SDL2 diff --git a/src/utils/sdlhelper.h b/src/utils/sdlhelper.h index 9d122f934..912528a29 100644 --- a/src/utils/sdlhelper.h +++ b/src/utils/sdlhelper.h @@ -41,6 +41,7 @@ namespace SDL void SetWindowIcon(SDL_Surface *const window A_UNUSED, SDL_Surface *const icon); + void grabInput(SDL_Surface *const window A_UNUSED, const bool grab); } // namespace SDL #endif // USE_SDL2 |