423 {$ENDIF} |
423 {$ENDIF} |
424 begin |
424 begin |
425 if Length(s) = 0 then cFullScreen:= not cFullScreen |
425 if Length(s) = 0 then cFullScreen:= not cFullScreen |
426 else cFullScreen:= s = '1'; |
426 else cFullScreen:= s = '1'; |
427 |
427 |
|
428 {$IFDEF DEBUGFILE} |
|
429 AddFileLog('Prepare to change video parameters...'); |
|
430 {$ENDIF} |
428 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
431 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
429 |
432 |
430 flags:= SDL_OPENGL; |
433 flags:= SDL_OPENGL; |
431 if cFullScreen then flags:= flags or SDL_FULLSCREEN |
434 if cFullScreen then flags:= flags or SDL_FULLSCREEN |
432 else SDL_WM_SetCaption('Hedgewars', nil); |
435 else SDL_WM_SetCaption('Hedgewars', nil); |
|
436 {$IFDEF DEBUGFILE} |
|
437 AddFileLog('Freeing old primary surface...'); |
|
438 {$ENDIF} |
433 SDL_FreeSurface(SDLPrimSurface); |
439 SDL_FreeSurface(SDLPrimSurface); |
434 |
440 |
435 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags); |
441 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags); |
436 SDLTry(SDLPrimSurface <> nil, true); |
442 SDLTry(SDLPrimSurface <> nil, true); |
437 |
443 |
|
444 {$IFDEF DEBUGFILE} |
|
445 AddFileLog('Setting up OpenGL...'); |
|
446 {$ENDIF} |
438 SetupOpenGL(); |
447 SetupOpenGL(); |
439 |
448 |
440 {$IFDEF DEBUGFILE} |
449 {$IFDEF DEBUGFILE} |
441 AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf)))); |
450 AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf)))); |
442 {$ENDIF} |
451 {$ENDIF} |