Changed TranslateFlags to actually translate flags instead of using switch

This commit is contained in:
Goz3rr 2014-05-15 11:52:55 +02:00
parent 4414886832
commit 399e08ee33

View file

@ -108,20 +108,20 @@ namespace OpenTK.Platform.SDL2
static WindowFlags TranslateFlags(GameWindowFlags flags) static WindowFlags TranslateFlags(GameWindowFlags flags)
{ {
switch (flags) WindowFlags windowFlags = WindowFlags.Default;
if ((flags & GameWindowFlags.Fullscreen) != 0)
{ {
case GameWindowFlags.Fullscreen: if (Sdl2Factory.UseFullscreenDesktop)
if (Sdl2Factory.UseFullscreenDesktop) windowFlags |= WindowFlags.FULLSCREEN_DESKTOP;
return WindowFlags.FULLSCREEN_DESKTOP; else
else windowFlags |= WindowFlags.FULLSCREEN;
return WindowFlags.FULLSCREEN;
case GameWindowFlags.FixedWindow:
return WindowFlags.Default;
default:
return WindowFlags.Default | WindowFlags.RESIZABLE;
} }
if ((flags & GameWindowFlags.FixedWindow) == 0)
windowFlags |= WindowFlags.RESIZABLE;
return windowFlags;
} }
static Key TranslateKey(Scancode scan) static Key TranslateKey(Scancode scan)