From 4bedb0fe9741b99fe625f8b8e1349ff355d1fe2d Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 21 May 2008 18:26:17 +0000 Subject: "whitescreen on window resizing" bug fixed git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1114 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMain.pas | 10 ++++++++-- 1 file 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; -- cgit v1.2.3