forked from MoonsideGames/MoonWorks
recenter window on windowed mode change
parent
00366cc9d4
commit
b1fe7f96b2
|
@ -73,9 +73,14 @@ namespace MoonWorks
|
||||||
windowFlag = SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
windowFlag = SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenMode = screenMode;
|
|
||||||
|
|
||||||
SDL.SDL_SetWindowFullscreen(Handle, (uint) windowFlag);
|
SDL.SDL_SetWindowFullscreen(Handle, (uint) windowFlag);
|
||||||
|
|
||||||
|
if (screenMode == ScreenMode.Windowed)
|
||||||
|
{
|
||||||
|
SDL.SDL_SetWindowPosition(Handle, SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenMode = screenMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -89,6 +94,11 @@ namespace MoonWorks
|
||||||
SDL.SDL_SetWindowSize(Handle, (int) width, (int) height);
|
SDL.SDL_SetWindowSize(Handle, (int) width, (int) height);
|
||||||
Width = width;
|
Width = width;
|
||||||
Height = height;
|
Height = height;
|
||||||
|
|
||||||
|
if (ScreenMode == ScreenMode.Windowed)
|
||||||
|
{
|
||||||
|
SDL.SDL_SetWindowPosition(Handle, SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Window Lookup(uint windowID)
|
internal static Window Lookup(uint windowID)
|
||||||
|
|
Loading…
Reference in New Issue