aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-08 17:30:02 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-08 17:30:02 +0000
commitcf5f75f937a65da3e086ce78c2d0db6f850619c1 (patch)
tree0d3d533d2a6615a22832a3965ea6e5ac14101bcc /Game/Code
parent504358ffc7e64b427988063f65ff3b41c4870bff (diff)
downloadusdx-cf5f75f937a65da3e086ce78c2d0db6f850619c1.tar.gz
usdx-cf5f75f937a65da3e086ce78c2d0db6f850619c1.tar.xz
usdx-cf5f75f937a65da3e086ce78c2d0db6f850619c1.zip
linux needs a call to SDL_SetVideoMode after resizing. Otherwise the screen will be corrupted.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1248 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-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