diff options
Diffstat (limited to 'src/sdl')
| -rw-r--r-- | src/sdl/sdl_glimp.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index cc3e6378..a54a9b47 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -223,7 +223,7 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor  {  	const char *glstring;  	int perChannelColorBits; -	int colorBits, depthBits, stencilBits; +	int colorBits, alphaBits, depthBits, stencilBits;  	int samples;  	int i = 0;  	SDL_Surface *icon = NULL; @@ -354,6 +354,8 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor  	if ((!colorBits) || (colorBits >= 32))  		colorBits = 24; +	alphaBits = r_alphabits->value; +  	if (!r_depthbits->value)  		depthBits = 24;  	else @@ -430,12 +432,14 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor  			perChannelColorBits = 0; /* Use minimum size for 16-bit color */  		/* Need alpha or else SGIs choose 36+ bit RGB mode */ -		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1); +		if (alphaBits < 1) +			alphaBits = 1;  #endif  		SDL_GL_SetAttribute( SDL_GL_RED_SIZE, perChannelColorBits );  		SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, perChannelColorBits );  		SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, perChannelColorBits ); +		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, alphaBits );  		SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, testDepthBits );  		SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, testStencilBits );  | 
