From 0d2d350e8eb6f57be31f926897e39c6483eeee75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 19 Feb 2012 20:10:11 +0300 Subject: Add option to grab/ungrab input to game window. --- src/client.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index e6aeb22e2..949dbacd2 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -562,6 +562,8 @@ void Client::gameInit() } } + applyGrabMode(); + // Initialize for drawing mainGraphics->_beginDraw(); @@ -2429,3 +2431,9 @@ void Client::resizeVideo(int width, int height, bool always) config.setValue("screenheight", height); } } + +void Client::applyGrabMode() +{ + SDL_WM_GrabInput(config.getBoolValue("grabinput") + ? SDL_GRAB_ON : SDL_GRAB_OFF); +} -- cgit v1.2.3-70-g09d2