Fixed: Compilation under Mac OS X 10.5

This commit is contained in:
kervala 2010-10-04 21:47:26 +02:00
parent e2967cf317
commit f655a8d015

View file

@ -30,6 +30,7 @@
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <OpenGL/OpenGL.h>
namespace NL3D { namespace MAC { namespace NL3D { namespace MAC {
@ -335,13 +336,14 @@ bool setWindowStyle(nlWindow wnd, bool fullscreen)
// put the view in fullscreen mode, hiding the dock but enabling the menubar // put the view in fullscreen mode, hiding the dock but enabling the menubar
// to pop up if the mouse hits the top screen border. // to pop up if the mouse hits the top screen border.
// NOTE: withOptions:nil disables <CMD>+<Tab> application switching! // NOTE: withOptions:nil disables <CMD>+<Tab> application switching!
#ifdef MAC_OS_X_VERSION_10_6
[superview enterFullScreenMode:[NSScreen mainScreen] withOptions: [superview enterFullScreenMode:[NSScreen mainScreen] withOptions:
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: [NSNumber numberWithInt:
NSApplicationPresentationHideDock | NSApplicationPresentationHideDock |
NSApplicationPresentationAutoHideMenuBar], NSApplicationPresentationAutoHideMenuBar],
NSFullScreenModeApplicationPresentationOptions, nil]]; NSFullScreenModeApplicationPresentationOptions, nil]];
#endif // MAC_OS_X_VERSION_10_6
/* /*
TODO check if simply using NSView enterFullScreenMode is a good idea. TODO check if simply using NSView enterFullScreenMode is a good idea.
the context can be set to full screen as well, performance differences? the context can be set to full screen as well, performance differences?
@ -386,6 +388,7 @@ void getCurrentScreenMode(nlWindow wnd, GfxMode& mode)
} }
} }
#ifdef MAC_OS_X_VERSION_10_6
/// helper to extract bits per pixel value from screen mode, only 16 or 32 bits /// helper to extract bits per pixel value from screen mode, only 16 or 32 bits
static int bppFromDisplayMode(CGDisplayModeRef mode) static int bppFromDisplayMode(CGDisplayModeRef mode)
{ {
@ -401,6 +404,7 @@ static int bppFromDisplayMode(CGDisplayModeRef mode)
return 0; return 0;
} }
#endif // MAC_OS_X_VERSION_10_6
/// get the list of available screen modes /// get the list of available screen modes
bool getModes(std::vector<GfxMode> &modes) bool getModes(std::vector<GfxMode> &modes)
@ -418,6 +422,7 @@ bool getModes(std::vector<GfxMode> &modes)
nldebug("3D: %d displays found", (int)numDisplays); nldebug("3D: %d displays found", (int)numDisplays);
#ifdef MAC_OS_X_VERSION_10_6
for (CGDisplayCount i = 0; i < numDisplays; ++i) for (CGDisplayCount i = 0; i < numDisplays; ++i)
{ {
CGDirectDisplayID dspy = display[i]; CGDirectDisplayID dspy = display[i];
@ -455,6 +460,7 @@ bool getModes(std::vector<GfxMode> &modes)
} }
} }
} }
#endif // MAC_OS_X_VERSION_10_6
return true; return true;
} }
@ -1086,12 +1092,14 @@ void submitEvents(NLMISC::CEventServer& server,
case NSOtherMouseDown:break; case NSOtherMouseDown:break;
case NSOtherMouseUp:break; case NSOtherMouseUp:break;
case NSOtherMouseDragged:break; case NSOtherMouseDragged:break;
#ifdef MAC_OS_X_VERSION_10_6
case NSEventTypeGesture:break; case NSEventTypeGesture:break;
case NSEventTypeMagnify:break; case NSEventTypeMagnify:break;
case NSEventTypeSwipe:break; case NSEventTypeSwipe:break;
case NSEventTypeRotate:break; case NSEventTypeRotate:break;
case NSEventTypeBeginGesture:break; case NSEventTypeBeginGesture:break;
case NSEventTypeEndGesture:break; case NSEventTypeEndGesture:break;
#endif // MAC_OS_X_VERSION_10_6
default: default:
{ {
nlwarning("Unknown event type. dropping."); nlwarning("Unknown event type. dropping.");