summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-19 20:10:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-19 20:10:11 +0300
commit0d2d350e8eb6f57be31f926897e39c6483eeee75 (patch)
treed99094da424eeff854667b30d1cf5bf72babaf09 /src/client.cpp
parentc097592c3f05168499603901a19479cb07fc6cc1 (diff)
downloadManaVerse-0d2d350e8eb6f57be31f926897e39c6483eeee75.tar.gz
ManaVerse-0d2d350e8eb6f57be31f926897e39c6483eeee75.tar.bz2
ManaVerse-0d2d350e8eb6f57be31f926897e39c6483eeee75.tar.xz
ManaVerse-0d2d350e8eb6f57be31f926897e39c6483eeee75.zip
Add option to grab/ungrab input to game window.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp8
1 files changed, 8 insertions, 0 deletions
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);
+}