929 // the values in x and y make the window appear in the center |
929 // the values in x and y make the window appear in the center |
930 // on ios, make the sdl window appear on the second monitor when present |
930 // on ios, make the sdl window appear on the second monitor when present |
931 x:= (SDL_WINDOWPOS_CENTERED_MASK or {$IFDEF IPHONEOS}(SDL_GetNumVideoDisplays() - 1){$ELSE}0{$ENDIF}); |
931 x:= (SDL_WINDOWPOS_CENTERED_MASK or {$IFDEF IPHONEOS}(SDL_GetNumVideoDisplays() - 1){$ELSE}0{$ENDIF}); |
932 y:= (SDL_WINDOWPOS_CENTERED_MASK or {$IFDEF IPHONEOS}(SDL_GetNumVideoDisplays() - 1){$ELSE}0{$ENDIF}); |
932 y:= (SDL_WINDOWPOS_CENTERED_MASK or {$IFDEF IPHONEOS}(SDL_GetNumVideoDisplays() - 1){$ELSE}0{$ENDIF}); |
933 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN |
933 SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN |
934 {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS {$ENDIF}); |
934 {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS {$ENDIF}); // do not set SDL_WINDOW_RESIZABLE on iOS |
935 SDLrender:= SDL_CreateRenderer(SDLwindow, -1, SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC); |
935 SDLrender:= SDL_CreateRenderer(SDLwindow, -1, SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC); |
936 end; |
936 end; |
937 |
937 |
938 SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255); |
938 SDL_SetRenderDrawColor(SDLrender, 0, 0, 0, 255); |
939 SDL_RenderClear(SDLrender); |
939 SDL_RenderClear(SDLrender); |