1053 {$ENDIF} |
1053 {$ENDIF} |
1054 {$IFDEF SDL13} |
1054 {$IFDEF SDL13} |
1055 // these values in x and y make the window appear in the center |
1055 // these values in x and y make the window appear in the center |
1056 x:= SDL_WINDOWPOS_CENTERED_MASK; |
1056 x:= SDL_WINDOWPOS_CENTERED_MASK; |
1057 y:= SDL_WINDOWPOS_CENTERED_MASK; |
1057 y:= SDL_WINDOWPOS_CENTERED_MASK; |
1058 flags:= SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN; |
1058 // SDL_WINDOW_RESIZABLE makes the window respond to rotation events on mobile devices |
|
1059 flags:= SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN or SDL_WINDOW_RESIZABLE; |
1059 |
1060 |
1060 {$IFDEF MOBILE} |
1061 {$IFDEF MOBILE} |
1061 // make the sdl window appear on the second monitor when present |
|
1062 x:= x or (SDL_GetNumVideoDisplays() - 1); |
|
1063 y:= y or (SDL_GetNumVideoDisplays() - 1); |
|
1064 |
|
1065 if isPhone() then |
1062 if isPhone() then |
1066 SDL_SetHint('SDL_IOS_ORIENTATIONS','LandscapeLeft LandscapeRight'); |
1063 SDL_SetHint('SDL_IOS_ORIENTATIONS','LandscapeLeft LandscapeRight'); |
1067 |
1064 // no need for borders on mobile devices |
1068 // on mobile the SDL_WINDOW_RESIZABLE makes the window respond to rotation events |
1065 flags:= flags or SDL_WINDOW_BORDERLESS; |
1069 flags:= flags or SDL_WINDOW_BORDERLESS or SDL_WINDOW_RESIZABLE; |
|
1070 {$ENDIF} |
1066 {$ENDIF} |
1071 |
1067 |
1072 if SDLwindow = nil then |
1068 if SDLwindow = nil then |
1073 if cFullScreen then |
1069 if cFullScreen then |
1074 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN) |
1070 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN) |