aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Classes/UMain.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index 6a87f78f..cb23830e 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -443,8 +443,16 @@ begin
begin
ScreenW := Event.resize.w;
ScreenH := Event.resize.h;
- // Note: do NOT call SDL_SetVideoMode here. This would create a new
- // OpenGL render-context and all texture data would be invalidated.
+ // Note: do NOT call SDL_SetVideoMode on Windows and MacOSX here.
+ // This would create a new OpenGL render-context and all texture data
+ // would be invalidated.
+ // On Linux the mode MUST be resetted, otherwise graphics will be corrupted.
+ {$IFDEF LINUX}
+ if boolean( Ini.FullScreen ) then
+ SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN)
+ else
+ SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_RESIZABLE);
+ {$ENDIF}
end;
SDL_KEYDOWN:
begin