aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/UGraphic.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-15 08:39:59 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-15 08:39:59 +0000
commitb277ee24fdac7c45e159262ac9645d7cc42c5f22 (patch)
tree35ec349d706664fa13c067d0cc4ef7c2a0c48465 /src/base/UGraphic.pas
parentd416ec72d686b15dc1d8083251b33cfe017213fc (diff)
downloadusdx-b277ee24fdac7c45e159262ac9645d7cc42c5f22.tar.gz
usdx-b277ee24fdac7c45e159262ac9645d7cc42c5f22.tar.xz
usdx-b277ee24fdac7c45e159262ac9645d7cc42c5f22.zip
Do not set a minimum size for the alpha component of the screen mode (SDL_GL_ALPHA_SIZE), otherwise on a few systems with some versions of SDL (at least 1.2.11) SDL_SetVideoMode will fail.
The problem occured if the adjusted color component sizes did not leave any space for alpha, e.g. red/green/blue ajusted from 5 to 8: r_size+g_size+b_size = 24, so an alpha of at least 5 is just available if the depth is 32bit. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1383 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/UGraphic.pas')
-rw-r--r--src/base/UGraphic.pas16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas
index 74088cd9..35d8fd3b 100644
--- a/src/base/UGraphic.pas
+++ b/src/base/UGraphic.pas
@@ -445,8 +445,8 @@ begin
//Log.BenchmarkStart(2);
Texture := TTextureUnit.Create;
- // FIXME: this does not seem to be correct as Limit is the max. of either
- // width or height.
+ // FIXME: this does not seem to be correct as Limit.
+ // Is the max. of either width or height.
Texture.Limit := 1024*1024;
//LoadTextures;
@@ -504,7 +504,7 @@ begin
// TODO:
// here should be a loop which
// * draws the loading screen (form time to time)
- // * controlls the "process of the loading screen
+ // * controlls the "process of the loading screen"
// * checks if the loadingthread has loaded textures (check mutex) and
// * load the textures into opengl
// * tells the loadingthread, that the memory for the texture can be reused
@@ -555,10 +555,17 @@ begin
else
Screens := Ini.Screens + 1;
+ // Set minimum color component sizes
+ // Note: Do NOT use SDL_GL_ALPHA_SIZE here, otherwise on a few systems with
+ // some versions of SDL (at least 1.2.11) SDL_SetVideoMode will fail.
+ // The problem occured if the adjusted color component sizes did not leave
+ // any space for alpha, e.g. red/green/blue ajusted from 5 to 8:
+ // r_size+g_size+b_size = 24, so an alpha of at least 5 is just available if
+ // the depth is 32bit.
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
- SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 5);
+
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); // Z-Buffer depth
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@@ -584,7 +591,6 @@ begin
Depth := Ini.Depth;
Log.LogStatus('SDL_SetVideoMode', 'Initialize3D');
- //SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
if (Ini.FullScreen = 0) and (Not Params.FullScreen) then
begin