From 60264048d05b810bcdbdace2bbe8d860ad953996 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 21 Sep 2003 07:00:01 +0000 Subject: [PATCH] Bail if not actually SDL 1.2.6. --- stepmania/src/StepMania.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 0e4dd16ad6..4a2278bd5b 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -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();