minimum SDL version requirement?

Ludwig Nussel ludwig.nussel at suse.de
Thu Sep 6 07:53:05 EDT 2007


Hi,

What's the minimum SDL version we want to support? I ask because the
distro I used to build RPMs with (SLES9) has 1.2.7 and current svn
trunk does not build with that. The following patch is needed to
make it work. Ok to commit?
Running ioq3 built with SDL >= 1.2.7 on a (ppc) system with an even
older libSDL will crash ioq3 at runtime due to unresolved symbols.

Index: ioquake3-1.35_SVN1167/code/sdl/sdl_glimp.c
===================================================================
--- ioquake3-1.35_SVN1167.orig/code/sdl/sdl_glimp.c
+++ ioquake3-1.35_SVN1167/code/sdl/sdl_glimp.c
@@ -47,6 +47,11 @@ typedef void *QGLContext;
 #define GLimp_SetCurrentContext(ctx)
 #endif
 
+#if (SDL_COMPILEDVERSION < SDL_VERSIONNUM(1, 2, 10))
+#define SDL_GL_ACCELERATED_VISUAL 15
+#define SDL_GL_SWAP_CONTROL 16
+#endif
+
 static QGLContext opengl_context;
 
 typedef enum
Index: ioquake3-1.35_SVN1167/code/sys/sys_main.c
===================================================================
--- ioquake3-1.35_SVN1167.orig/code/sys/sys_main.c
+++ ioquake3-1.35_SVN1167/code/sys/sys_main.c
@@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin St, Fifth 
 
 #ifndef DEDICATED
 #include "SDL.h"
+#if (SDL_COMPILEDVERSION < SDL_VERSIONNUM(1, 2, 10))
+#include "SDL_cpuinfo.h"
+#endif
 #endif
 
 #include "sys_local.h"
@@ -194,6 +197,8 @@ cpuFeatures_t Sys_GetProcessorFeatures( 
 	cpuFeatures_t features = 0;
 
 #ifndef DEDICATED
+#if SDL_VERSION_ATLEAST(1,2,7)
+// XXX: with an old SDL lib this will crash at runtime
 	if( SDL_HasRDTSC( ) )    features |= CF_RDTSC;
 	if( SDL_HasMMX( ) )      features |= CF_MMX;
 	if( SDL_HasMMXExt( ) )   features |= CF_MMX_EXT;
@@ -202,6 +207,9 @@ cpuFeatures_t Sys_GetProcessorFeatures( 
 	if( SDL_HasSSE( ) )      features |= CF_SSE;
 	if( SDL_HasSSE2( ) )     features |= CF_SSE2;
 	if( SDL_HasAltiVec( ) )  features |= CF_ALTIVEC;
+#else
+#warning Need SDL >= 1.2.7 to detect CPU features
+#endif
 #endif
 
 	return features;

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)




More information about the quake3 mailing list