From Cameron Eure:
Fixes a problem in code/unix/linux_glimp_sdl.c where attributes are called before there's a working visual, resulting in a crash.
This commit is contained in:
parent
ae7066fa3f
commit
6a84a13acf
1 changed files with 15 additions and 11 deletions
|
@ -638,18 +638,22 @@ static int GLW_SetMode( const char *drivername, int mode, qboolean fullscreen )
|
||||||
if (tcolorbits == 24)
|
if (tcolorbits == 24)
|
||||||
sdlcolorbits = 8;
|
sdlcolorbits = 8;
|
||||||
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, sdlcolorbits );
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, sdlcolorbits );
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, sdlcolorbits );
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, tdepthbits );
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, tstencilbits );
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
|
|
||||||
|
|
||||||
SDL_WM_SetCaption(WINDOW_CLASS_NAME, WINDOW_CLASS_NAME_BRIEF);
|
/* Cameron Eure - Please don't set attributes unless we have a working visual. */
|
||||||
SDL_ShowCursor(0);
|
if (vidscreen != NULL){
|
||||||
SDL_EnableUNICODE(1);
|
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, sdlcolorbits );
|
||||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, sdlcolorbits );
|
||||||
sdlrepeatenabled = qtrue;
|
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, sdlcolorbits );
|
||||||
|
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, tdepthbits );
|
||||||
|
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, tstencilbits );
|
||||||
|
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
|
||||||
|
|
||||||
|
SDL_WM_SetCaption(WINDOW_CLASS_NAME, WINDOW_CLASS_NAME_BRIEF);
|
||||||
|
SDL_ShowCursor(0);
|
||||||
|
SDL_EnableUNICODE(1);
|
||||||
|
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
|
sdlrepeatenabled = qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(vidscreen = SDL_SetVideoMode(glConfig.vidWidth, glConfig.vidHeight, colorbits, flags)))
|
if (!(vidscreen = SDL_SetVideoMode(glConfig.vidWidth, glConfig.vidHeight, colorbits, flags)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue