mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
Fixed: Compilation under Mac OS X 10.5
This commit is contained in:
parent
e2967cf317
commit
f655a8d015
1 changed files with 24 additions and 16 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <Carbon/Carbon.h>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <OpenGL/OpenGL.h>
|
||||
|
||||
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
|
||||
// to pop up if the mouse hits the top screen border.
|
||||
// NOTE: withOptions:nil disables <CMD>+<Tab> application switching!
|
||||
#ifdef MAC_OS_X_VERSION_10_6
|
||||
[superview enterFullScreenMode:[NSScreen mainScreen] withOptions:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:
|
||||
NSApplicationPresentationHideDock |
|
||||
NSApplicationPresentationAutoHideMenuBar],
|
||||
NSFullScreenModeApplicationPresentationOptions, nil]];
|
||||
|
||||
#endif // MAC_OS_X_VERSION_10_6
|
||||
/*
|
||||
TODO check if simply using NSView enterFullScreenMode is a good idea.
|
||||
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
|
||||
static int bppFromDisplayMode(CGDisplayModeRef mode)
|
||||
{
|
||||
|
@ -401,6 +404,7 @@ static int bppFromDisplayMode(CGDisplayModeRef mode)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif // MAC_OS_X_VERSION_10_6
|
||||
|
||||
/// get the list of available screen modes
|
||||
bool getModes(std::vector<GfxMode> &modes)
|
||||
|
@ -418,6 +422,7 @@ bool getModes(std::vector<GfxMode> &modes)
|
|||
|
||||
nldebug("3D: %d displays found", (int)numDisplays);
|
||||
|
||||
#ifdef MAC_OS_X_VERSION_10_6
|
||||
for (CGDisplayCount i = 0; i < numDisplays; ++i)
|
||||
{
|
||||
CGDirectDisplayID dspy = display[i];
|
||||
|
@ -455,6 +460,7 @@ bool getModes(std::vector<GfxMode> &modes)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // MAC_OS_X_VERSION_10_6
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1086,12 +1092,14 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
case NSOtherMouseDown:break;
|
||||
case NSOtherMouseUp:break;
|
||||
case NSOtherMouseDragged:break;
|
||||
#ifdef MAC_OS_X_VERSION_10_6
|
||||
case NSEventTypeGesture:break;
|
||||
case NSEventTypeMagnify:break;
|
||||
case NSEventTypeSwipe:break;
|
||||
case NSEventTypeRotate:break;
|
||||
case NSEventTypeBeginGesture:break;
|
||||
case NSEventTypeEndGesture:break;
|
||||
#endif // MAC_OS_X_VERSION_10_6
|
||||
default:
|
||||
{
|
||||
nlwarning("Unknown event type. dropping.");
|
||||
|
|
Loading…
Reference in a new issue