diff --git a/src/Window.cs b/src/Window.cs index 194f7d0a..8354663c 100644 --- a/src/Window.cs +++ b/src/Window.cs @@ -73,9 +73,14 @@ namespace MoonWorks windowFlag = SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP; } - ScreenMode = screenMode; - SDL.SDL_SetWindowFullscreen(Handle, (uint) windowFlag); + + if (screenMode == ScreenMode.Windowed) + { + SDL.SDL_SetWindowPosition(Handle, SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED); + } + + ScreenMode = screenMode; } /// @@ -89,6 +94,11 @@ namespace MoonWorks SDL.SDL_SetWindowSize(Handle, (int) width, (int) height); Width = width; Height = height; + + if (ScreenMode == ScreenMode.Windowed) + { + SDL.SDL_SetWindowPosition(Handle, SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED); + } } internal static Window Lookup(uint windowID)