Simplify exception handling. Improve fallback if we can't set up an

OpenGL window.
This commit is contained in:
Glenn Maynard
2003-06-25 20:44:49 +00:00
parent 1d655dcb7a
commit 2206e32cef
4 changed files with 28 additions and 15 deletions
+18 -2
View File
@@ -232,7 +232,7 @@ static void FlushGLErrors()
;
}
RageDisplay_OGL::RageDisplay_OGL( VideoModeParams p )
RageDisplay_OGL::RageDisplay_OGL( VideoModeParams p, bool bAllowUnacceleratedRenderer )
{
LOG->Trace( "RageDisplay_OGL::RageDisplay_OGL()" );
LOG->MapLog("renderer", "Current renderer: OpenGL");
@@ -241,15 +241,31 @@ RageDisplay_OGL::RageDisplay_OGL( VideoModeParams p )
wind = MakeLowLevelWindow();
SetVideoMode( p );
try {
SetVideoMode( p );
} catch(...) {
/* SetVideoMode can throw. */
delete wind;
throw;
}
// Log driver details
LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR));
LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER));
LOG->Info("OGL Version: %s", glGetString(GL_VERSION));
LOG->Info("OGL Extensions: %s", glGetString(GL_EXTENSIONS));
if( IsSoftwareRenderer() )
{
if( !bAllowUnacceleratedRenderer )
{
delete wind;
RageException::ThrowNonfatal(
"Your system is reporting that OpenGL hardware acceleration is not available. "
"Please obtain an updated driver from your video card manufacturer.\n\n" );
}
LOG->Warn("This is a software renderer!");
}
/* Log this, so if people complain that the radar looks bad on their