From cf5f75f937a65da3e086ce78c2d0db6f850619c1 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 8 Aug 2008 17:30:02 +0000 Subject: 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 --- Game/Code/Classes/UMain.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/UMain.pas') 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 -- cgit v1.2.3