fix SDL_VIDEODRIVER not being set for SDL loading windows

This commit is contained in:
Glenn Maynard
2004-09-16 21:32:14 +00:00
parent 51a259c6a5
commit cd61a9fd27
2 changed files with 18 additions and 18 deletions
+18
View File
@@ -263,6 +263,24 @@ void SetupSDL()
/* Attempt to shut down the window on crash. */
RegisterEmergencyShutdownCallback( EmergencyShutdownSDL );
#endif
#if defined(LINUX)
static bool bSetVideoDriver = false;
if( !bSetVideoDriver )
{
bSetVideoDriver = true;
/* Most people don't have this set. SDL has a habit of trying to
* fall back on other drivers (svgalib, aalib), so set it to "x11". */
const char *sVideoDriver = getenv("SDL_VIDEODRIVER");
if( sVideoDriver == NULL || sVideoDriver[0] == 0 )
{
static char env[] = "SDL_VIDEODRIVER=x11";
putenv( env );
} else if( strcmp( sVideoDriver, "x11" ) )
LOG->Info( "SDL_VIDEODRIVER has been set to %s", sVideoDriver );
}
#endif
}
/*