src/video/cocoa/cocoa_v.mm
changeset 7965 e651c71175d6
parent 7952 f5613142e669
child 7984 f01c62b32738
--- a/src/video/cocoa/cocoa_v.mm	Sun Nov 25 12:58:32 2007 +0000
+++ b/src/video/cocoa/cocoa_v.mm	Sun Nov 25 14:43:16 2007 +0000
@@ -8,6 +8,7 @@
 
 #ifdef WITH_COCOA
 
+#define MAC_OS_X_VERSION_MIN_REQUIRED    MAC_OS_X_VERSION_10_3
 #include <AvailabilityMacros.h>
 
 #import <Cocoa/Cocoa.h>
@@ -229,13 +230,17 @@
 
 static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp)
 {
-	long sysVersion;
+	CocoaSubdriver *ret;
 
-	if (Gestalt(gestaltSystemVersion, &sysVersion) == noErr && sysVersion >= 0x1040) {
-		return QZ_CreateWindowQuartzSubdriver(width, height, bpp);
+	if (MacOSVersionIsAtLeast(10, 4, 0)) {
+		ret = QZ_CreateWindowQuartzSubdriver(width, height, bpp);
+		if (ret != NULL) return ret;
 	}
 
-	return QZ_CreateWindowQuickdrawSubdriver(width, height, bpp);
+	ret = QZ_CreateWindowQuickdrawSubdriver(width, height, bpp);
+	if (ret != NULL) return ret;
+
+	return NULL;
 }
 
 
@@ -282,6 +287,8 @@
 {
 	int width, height, bpp;
 
+	if (!MacOSVersionIsAtLeast(10, 3, 0)) return "The Cocoa video driver requires Mac OS X 10.3 or later.";
+
 	if (_cocoa_video_started) return "Already started";
 	_cocoa_video_started = true;