From: havoc Date: Mon, 18 Oct 2004 10:16:26 +0000 (+0000) Subject: add support for 32bit color in SDL builds X-Git-Tag: xonotic-v0.1.0preview~5459 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=be78599265318efb91ca18071f3f9356c4e5a7ea add support for 32bit color in SDL builds git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4664 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_sdl.c b/vid_sdl.c index 5dfb6242..b366fd9b 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -415,11 +415,23 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp) vid_isfullscreen = true; } - SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 1); - SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 1); - SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 1); - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); + if (bpp >= 32) + { + SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 8); + SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 24); + SDL_GL_SetAttribute (SDL_GL_STENCIL_SIZE, 8); + } + else + { + SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 1); + SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 1); + SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 1); + SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16); + } screen = SDL_SetVideoMode(width, height, bpp, flags); if (screen == NULL)