Bail if not actually SDL 1.2.6.

This commit is contained in:
Glenn Maynard
2003-09-21 07:00:01 +00:00
parent 4ff7943de9
commit 60264048d0
+15
View File
@@ -484,6 +484,19 @@ RageDisplay *CreateDisplay()
RageException::Throw( error );
}
static void CheckSDLVersion( int major, int minor, int patch )
{
const SDL_version *ver = SDL_Linked_Version();
if( ver->major > major ||
(ver->major == major && ver->minor > minor) ||
(ver->major == major && ver->minor == minor && ver->patch >= patch))
return;
RageException::Throw( "SDL %i.%i.%i is required, but you only appear to "
"have SDL %i.%i.%i installed. Please upgrade your installation of SDL or download "
"it from:\n\n\thttp://www.libsdl.org/",
major, minor, patch, ver->major, ver->minor, ver->patch );
}
static void RestoreAppPri()
{
@@ -546,6 +559,8 @@ int main(int argc, char* argv[])
if( PREFSMAN->m_bShowLogWindow )
LOG->ShowConsole();
CheckSDLVersion( 1,2,6 );
/* This should be done after PREFSMAN is set up, so it can use HOOKS->MessageBoxOK,
* but before we do more complex things that might crash. */
HOOKS->DumpDebugInfo();