(svn r11521) -Codechange: [OSX] Check what the running os version is in a cleaner way.

This commit is contained in:
egladil
2007-11-25 14:43:16 +00:00
parent 9aaa455e5d
commit 1d5010edf9
9 changed files with 153 additions and 5 deletions

View File

@@ -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 @@ void QZ_GameSizeChanged()
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 @@ const char *VideoDriver_Cocoa::Start(const char * const *parm)
{
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;