Adding SDL2 window grab on loading the game. Made this behaviour configurable in the 'Input' tab of the Settings menu

Updated settings file for TD to expose the new 'Lock mouse to window' display configuration option

A text label notes that modifying the 'Lock mouse' check box requires a restart
This commit is contained in:
Gordon Martin
2014-06-09 01:35:03 +01:00
parent bc103f8ffd
commit 5eab479c34
5 changed files with 36 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ namespace OpenRA.Renderer.Sdl2
window = SDL.SDL_CreateWindow("OpenRA", SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED, size.Width, size.Height, SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL);
var lockWindow = Game.Settings.Game.LockMouseWindow ? SDL.SDL_bool.SDL_TRUE : SDL.SDL_bool.SDL_FALSE;
SDL.SDL_SetWindowGrab(window, lockWindow);
if (windowMode == WindowMode.Fullscreen)
SDL.SDL_SetWindowFullscreen(window, (uint)SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN);
else if (windowMode == WindowMode.PseudoFullscreen)