Permalink
Browse files

Merge branch 'develop' of git://github.com/Goz3rr/opentk into pr/122

  • Loading branch information...
2 parents 687fc90 + 0c348d2 commit d6426f20bd6f06446464dfa967ddfd94f326d1ae @thefiddler thefiddler committed May 19, 2014
Showing with 25 additions and 10 deletions.
  1. +5 −0 Source/OpenTK/GameWindowFlags.cs
  2. +5 −0 Source/OpenTK/NativeWindow.cs
  3. +15 −10 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
5 Source/OpenTK/NativeWindow.cs
@@ -112,6 +112,11 @@ public NativeWindow(int x, int y, int width, int height, string title, GameWindo
}
WindowState = WindowState.Fullscreen;
}
+
+ if ((options & GameWindowFlags.FixedWindow) != 0)
+ {
+ WindowBorder = WindowBorder.Fixed;
+ }
}
#endregion
View
25 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)
{
@@ -106,17 +108,20 @@ class Sdl2NativeWindow : NativeWindowBase
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)

0 comments on commit d6426f2

Please sign in to comment.