596 procedure chFullScr(var s: shortstring); |
596 procedure chFullScr(var s: shortstring); |
597 var flags: Longword = 0; |
597 var flags: Longword = 0; |
598 {$IFDEF DEBUGFILE} |
598 {$IFDEF DEBUGFILE} |
599 buf: array[byte] of char; |
599 buf: array[byte] of char; |
600 {$ENDIF} |
600 {$ENDIF} |
601 {$IFDEF SDL13} |
|
602 windowID: TSDL_WindowID; |
|
603 {$ENDIF} |
|
604 begin |
601 begin |
605 if Length(s) = 0 then cFullScreen:= not cFullScreen |
602 if Length(s) = 0 then cFullScreen:= not cFullScreen |
606 else cFullScreen:= s = '1'; |
603 else cFullScreen:= s = '1'; |
607 |
604 |
608 {$IFDEF DEBUGFILE} |
605 {$IFDEF DEBUGFILE} |
629 AddFileLog('Freeing old primary surface...'); |
626 AddFileLog('Freeing old primary surface...'); |
630 {$ENDIF} |
627 {$ENDIF} |
631 SDL_FreeSurface(SDLPrimSurface); |
628 SDL_FreeSurface(SDLPrimSurface); |
632 end; |
629 end; |
633 |
630 |
634 {$IFDEF SDL13} |
|
635 windowID:= SDL_CreateWindow(nil, 0, 0, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN |
|
636 {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS{$ENDIF}); |
|
637 SDL_CreateRenderer(windowID, 0, 0); |
|
638 PixelFormat:=nil;// SDLPrimSurface^.format; |
|
639 |
|
640 SDL_SetRenderDrawColor(0, 0, 0, 255); |
|
641 SDL_RenderFill(nil); |
|
642 SDL_RenderPresent(); |
|
643 {$ELSE} |
|
644 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags); |
631 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags); |
645 SDLTry(SDLPrimSurface <> nil, true); |
632 SDLTry(SDLPrimSurface <> nil, true); |
646 PixelFormat:= SDLPrimSurface^.format; |
633 PixelFormat:= SDLPrimSurface^.format; |
647 {$ENDIF} |
|
648 |
634 |
649 {$IFDEF DEBUGFILE} |
635 {$IFDEF DEBUGFILE} |
650 AddFileLog('Setting up OpenGL...'); |
636 AddFileLog('Setting up OpenGL...'); |
651 AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf)))); |
637 AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf)))); |
652 {$ENDIF} |
638 {$ENDIF} |