aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-06 18:21:10 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-06 18:21:10 +0000
commit4e64b0a1b82badbf25bb32bd96290f96668c2290 (patch)
treeb6712eb8ada4742f54b84a507ce48070ed668b39 /code
parented3c9635a68e03c1448e64ff49824b65fa1f4776 (diff)
downloadioquake3-aero-4e64b0a1b82badbf25bb32bd96290f96668c2290.tar.gz
ioquake3-aero-4e64b0a1b82badbf25bb32bd96290f96668c2290.zip
* Compile time and runtime checks for SDL >= 1.2.7
* Modified versioning to play nice with the reverted Makefile change git-svn-id: svn://svn.icculus.org/quake3/trunk@1168 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/qcommon/q_shared.h8
-rw-r--r--code/sdl/sdl_glimp.c7
-rw-r--r--code/sys/sys_main.c19
3 files changed, 31 insertions, 3 deletions
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 12dd36e..458c53c 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -26,11 +26,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// q_shared.h -- included first by ALL program modules.
// A user mod should never modify this file
-#define Q3_VERSION_BASE "ioq3 1.35"
+#define PRODUCT_NAME "ioq3"
+#define PRODUCT_VERSION "1.35"
+
#ifdef SVN_VERSION
-# define Q3_VERSION Q3_VERSION_BASE "_SVN" SVN_VERSION
+# define Q3_VERSION PRODUCT_NAME " " SVN_VERSION
#else
-# define Q3_VERSION Q3_VERSION_BASE
+# define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION
#endif
#define CLIENT_WINDOW_TITLE "ioquake3"
diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c
index 4d8257f..b75380b 100644
--- a/code/sdl/sdl_glimp.c
+++ b/code/sdl/sdl_glimp.c
@@ -22,6 +22,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "SDL.h"
+#if !SDL_VERSION_ATLEAST(1, 2, 10)
+#define SDL_GL_ACCELERATED_VISUAL 15
+#define SDL_GL_SWAP_CONTROL 16
+#elif MINSDL_PATCH >= 10
+#error Code block no longer necessary, please remove
+#endif
+
#ifdef SMP
#include "SDL_thread.h"
#endif
diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c
index df74373..c73c2e4 100644
--- a/code/sys/sys_main.c
+++ b/code/sys/sys_main.c
@@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef DEDICATED
#include "SDL.h"
+#include "SDL_cpuinfo.h"
#endif
#include "sys_local.h"
@@ -604,6 +605,24 @@ int main( int argc, char **argv )
int i;
char commandLine[ MAX_STRING_CHARS ] = { 0 };
+#ifndef DEDICATED
+ const SDL_version *ver = SDL_Linked_Version( );
+
+#define STRING(s) #s
+#define XSTRING(s) STRING(s)
+#define MINSDL_VERSION \
+ XSTRING(MINSDL_MAJOR) "." \
+ XSTRING(MINSDL_MINOR) "." \
+ XSTRING(MINSDL_PATCH)
+
+ if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) <
+ SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
+ {
+ Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" );
+ Sys_Exit( 1 );
+ }
+#endif
+
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );