diff --git a/Source/OpenTK/GameWindowFlags.cs b/Source/OpenTK/GameWindowFlags.cs index 91bfca18..dfb6fbda 100644 --- a/Source/OpenTK/GameWindowFlags.cs +++ b/Source/OpenTK/GameWindowFlags.cs @@ -44,5 +44,10 @@ namespace OpenTK /// Indicates that the GameWindow should cover the whole screen. /// Fullscreen = 1, + + /// + /// Indicates that the GameWindow should be a fixed window. + /// + FixedWindow = 2, } } \ No newline at end of file diff --git a/Source/OpenTK/NativeWindow.cs b/Source/OpenTK/NativeWindow.cs index 96812c98..9b731f53 100644 --- a/Source/OpenTK/NativeWindow.cs +++ b/Source/OpenTK/NativeWindow.cs @@ -112,6 +112,11 @@ namespace OpenTK } WindowState = WindowState.Fullscreen; } + + if ((options & GameWindowFlags.FixedWindow) != 0) + { + WindowBorder = WindowBorder.Fixed; + } } #endregion diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index 036fb5c7..0e576e90 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -77,7 +77,6 @@ namespace OpenTK.Platform.SDL2 var bounds = device.Bounds; var flags = TranslateFlags(options); flags |= WindowFlags.OPENGL; - flags |= WindowFlags.RESIZABLE; flags |= WindowFlags.HIDDEN; if (Toolkit.Options.EnableHighResolution) { @@ -88,6 +87,9 @@ namespace OpenTK.Platform.SDL2 (flags & WindowFlags.FULLSCREEN) != 0) window_state = WindowState.Fullscreen; + if ((flags & WindowFlags.RESIZABLE) == 0) + window_border = WindowBorder.Fixed; + IntPtr handle; lock (SDL.Sync) { @@ -106,17 +108,20 @@ namespace OpenTK.Platform.SDL2 static WindowFlags TranslateFlags(GameWindowFlags flags) { - switch (flags) - { - case GameWindowFlags.Fullscreen: - if (Sdl2Factory.UseFullscreenDesktop) - return WindowFlags.FULLSCREEN_DESKTOP; - else - return WindowFlags.FULLSCREEN; + WindowFlags windowFlags = WindowFlags.Default; - default: - return WindowFlags.Default; + if ((flags & GameWindowFlags.Fullscreen) != 0) + { + if (Sdl2Factory.UseFullscreenDesktop) + windowFlags |= WindowFlags.FULLSCREEN_DESKTOP; + else + windowFlags |= WindowFlags.FULLSCREEN; } + + if ((flags & GameWindowFlags.FixedWindow) == 0) + windowFlags |= WindowFlags.RESIZABLE; + + return windowFlags; } static Key TranslateKey(Scancode scan)