#undef fiftyoh
#undef hundredoh
-static int MapKey( int sdlkey )
+static int MapKey( unsigned int sdlkey )
{
if( sdlkey > sizeof(tbl_sdltoquake)/ sizeof(int) )
return 0;
break;
case SDL_ACTIVEEVENT:
if( event.active.state == SDL_APPACTIVE )
+ {
if( event.active.gain )
vid_hidden = false;
else
vid_hidden = true;
+ }
break;
case SDL_MOUSEBUTTONDOWN:
if( event.button.button == SDL_BUTTON_MIDDLE )
drivername = "libGL.so.1";
#endif
-// COMMANDLINEOPTION: -gl_driver <drivername> selects a GL driver library, default is libGL.so.1 (Linux/BSD) or opengl32.dll (windows) or /usr/X11R6/lib/libGL.1.dylib (MacOSX), if you don't know what this is for, you don't need it
+// COMMANDLINEOPTION: SDL GL: -gl_driver <drivername> selects a GL driver library, default is libGL.so.1 (Linux/BSD) or opengl32.dll (windows) or OpenGL.framework (MacOSX), useful only for 3dfxogl.dll/3dfxvgl.dll or fxmesa or similar, if you don't know what this is for, you don't need it
i = COM_CheckParm("-gl_driver");
if (i && i < com_argc - 1)
drivername = com_argv[i + 1];
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)