Skip to content
Browse files

Added GameWindowFlags.FixedWindow to allow for fixed border SDL Windows

  • Loading branch information...
1 parent 1419c1e commit 4414886832a6574f03997cdd9a4e76dcd2aa7416 @Goz3rr Goz3rr committed
Showing with 12 additions and 2 deletions.
  1. +5 −0 Source/OpenTK/GameWindowFlags.cs
  2. +7 −2 Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs
View
5 Source/OpenTK/GameWindowFlags.cs
@@ -44,5 +44,10 @@ public enum GameWindowFlags
/// Indicates that the GameWindow should cover the whole screen.
/// </summary>
Fullscreen = 1,
+
+ /// <summary>
+ /// Indicates that the GameWindow should be a fixed window.
+ /// </summary>
+ FixedWindow = 2,
}
}
View
9 Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs
@@ -77,7 +77,6 @@ class Sdl2NativeWindow : NativeWindowBase
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 @@ class Sdl2NativeWindow : NativeWindowBase
(flags & WindowFlags.FULLSCREEN) != 0)
window_state = WindowState.Fullscreen;
+ if ((flags & WindowFlags.RESIZABLE) == 0)
+ window_border = WindowBorder.Fixed;
+
IntPtr handle;
lock (SDL.Sync)
{
@@ -114,8 +116,11 @@ static WindowFlags TranslateFlags(GameWindowFlags flags)
else
return WindowFlags.FULLSCREEN;
- default:
+ case GameWindowFlags.FixedWindow:
return WindowFlags.Default;
+
+ default:
+ return WindowFlags.Default | WindowFlags.RESIZABLE;
}
}

0 comments on commit 4414886

Please sign in to comment.
Something went wrong with that request. Please try again.