summaryrefslogtreecommitdiff
path: root/src/video/cocoa/wnd_quartz.mm
diff options
context:
space:
mode:
authoregladil <egladil@openttd.org>2007-11-25 14:43:16 +0000
committeregladil <egladil@openttd.org>2007-11-25 14:43:16 +0000
commit1d5010edf96789140f65c0495495a24c53b5ba1b (patch)
tree8ee1ef0bc994c64d37a179e595db5424e0af4375 /src/video/cocoa/wnd_quartz.mm
parent9aaa455e5d27690587a1ce1c9641ea7718874e10 (diff)
downloadopenttd-1d5010edf96789140f65c0495495a24c53b5ba1b.tar.xz
(svn r11521) -Codechange: [OSX] Check what the running os version is in a cleaner way.
Diffstat (limited to 'src/video/cocoa/wnd_quartz.mm')
-rw-r--r--src/video/cocoa/wnd_quartz.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 847bdc4b5..9df8525f3 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -8,6 +8,7 @@
#ifdef WITH_COCOA
+#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
#include <AvailabilityMacros.h>
#import <Cocoa/Cocoa.h>
@@ -685,6 +686,7 @@ CGPoint WindowQuartzSubdriver::PrivateLocalToCG(NSPoint* p)
p->y = window_height - p->y;
*p = [ qzview convertPoint:*p toView: nil ];
+
*p = [ window convertBaseToScreen:*p ];
p->y = device_height - p->y;
@@ -779,6 +781,11 @@ CocoaSubdriver *QZ_CreateWindowQuartzSubdriver(int width, int height, int bpp)
{
WindowQuartzSubdriver *ret;
+ if (!MacOSVersionIsAtLeast(10, 4, 0)) {
+ DEBUG(driver, 0, "The cocoa quartz subdriver requires Mac OS X 10.4 or later.");
+ return NULL;
+ }
+
if (bpp != 8 && bpp != 32) {
DEBUG(driver, 0, "The cocoa quartz subdriver only supports 8 and 32 bpp.");
return NULL;