X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_system.pas;h=29a81b01e0a38102289a515cf5500aa2156530ef;hp=6fff48bf9df526a268efb91334fdc23c31984b08;hb=7cd25bdadc9813ee693a5b4cabb87bbe3348b707;hpb=3056df542f2b65030778a518aaf7b1b852b3df73 diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index 6fff48b..29a81b0 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -191,8 +191,12 @@ implementation end else begin + if fullScreen then flags := SDL_WINDOW_FULLSCREEN else flags := 0; + SDL_SetWindowFullscreen(window, flags); SDL_SetWindowSize(window, w, h); - if wc then + if maximized then SDL_MaximizeWindow(window); + // always reset to center when changing fullscreen->windowed for safety purposes + if wc or (gFullscreen and not fullscreen) or (gWinMaximized and not maximized) then begin x := SDL_WINDOWPOS_CENTERED; y := SDL_WINDOWPOS_CENTERED @@ -208,10 +212,6 @@ implementation SDL_GetWindowPosition(window, @x, @y); wx := x; wy := y end; - if maximized then - SDL_MaximizeWindow(window); - if fullScreen then flags := SDL_WINDOW_FULLSCREEN else flags := 0; - SDL_SetWindowFullscreen(window, flags); gFullScreen := fullscreen; gWinMaximized := maximized; gRC_FullScreen := fullscreen;