aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-21 18:26:17 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-21 18:26:17 +0000
commit4bedb0fe9741b99fe625f8b8e1349ff355d1fe2d (patch)
tree9e6c5de1885f8aa2c0441f2da56f79f1ae371d37 /Game/Code
parent4cbefb8f24d2ccb0238a5e442701811d20b476a0 (diff)
downloadusdx-4bedb0fe9741b99fe625f8b8e1349ff355d1fe2d.tar.gz
usdx-4bedb0fe9741b99fe625f8b8e1349ff355d1fe2d.tar.xz
usdx-4bedb0fe9741b99fe625f8b8e1349ff355d1fe2d.zip
"whitescreen on window resizing" bug fixed
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1114 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
-rw-r--r--Game/Code/Classes/UMain.pas10
1 files changed, 8 insertions, 2 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index ea3da9ad..3e1a4ea1 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -443,8 +443,8 @@ begin
begin
ScreenW := Event.resize.w;
ScreenH := Event.resize.h;
-
- screen := SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_RESIZABLE);
+ // Note: do NOT call SDL_SetVideoMode here. This would create a new
+ // OpenGL render-context and all texture data would be invalidated.
end;
SDL_KEYDOWN:
begin
@@ -461,11 +461,17 @@ begin
if boolean( Ini.FullScreen ) then
begin
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN);
+ // FIXME: SDL_SetVideoMode creates a new OpenGL RC so we have to
+ // reload all texture data (-> whitescreen bug).
+ // Only Linux is able to handle screen-switching this way.
SDL_ShowCursor(0);
end
else
begin
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_RESIZABLE);
+ // FIXME: SDL_SetVideoMode creates a new OpenGL RC so we have to
+ // reload all texture data (-> whitescreen bug).
+ // Only Linux is able to handle screen-switching this way.
SDL_ShowCursor(1);
end;