diff src/video/directfb/SDL_DirectFB_video.h @ 3037:490f3e4fe753

Added DFB_VERSION_ATLEAST macro First attempt at replacing MakeSubSurface for pre 1.2.0 ==> Scaling not yet working
author Couriersud <couriersud@arcor.de>
date Tue, 13 Jan 2009 21:17:38 +0000
parents d72a0dd80e8b
children c73a5f8a03d2
line wrap: on
line diff
--- a/src/video/directfb/SDL_DirectFB_video.h	Tue Jan 13 19:31:06 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_video.h	Tue Jan 13 21:17:38 2009 +0000
@@ -34,13 +34,20 @@
 #define DEBUG 0
 #define LOG_CHANNEL 	stdout
 
-#if (DIRECTFB_MAJOR_VERSION < 1)
-#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
-#endif
+#define DFB_VERSIONNUM(X, Y, Z)						\
+	((X)*1000 + (Y)*100 + (Z))
+
+#define DFB_COMPILEDVERSION \
+	DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
 
-#if (DIRECTFB_MAJOR_VERSION >= 1) && (DIRECTFB_MINOR_VERSION >= 0) && (DIRECTFB_MICRO_VERSION >= 0 )
-#define SDL_DIRECTFB_OPENGL 1
-#include <directfbgl.h>
+#define DFB_VERSION_ATLEAST(X, Y, Z) \
+	(DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
+
+#if (DFB_VERSION_ATLEAST(1,0,0))
+	#define SDL_DIRECTFB_OPENGL 1
+	#include <directfbgl.h>
+#else
+	#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
 #endif
 
 #if SDL_DIRECTFB_OPENGL