diff --git a/source/Irrlicht/CIrrDeviceOSX.h b/source/Irrlicht/CIrrDeviceOSX.h index 701c5aaa..d5378c82 100644 --- a/source/Irrlicht/CIrrDeviceOSX.h +++ b/source/Irrlicht/CIrrDeviceOSX.h @@ -91,7 +91,7 @@ namespace irr //! Get the position of this window on screen virtual core::position2di getWindowPosition() _IRR_OVERRIDE_; - + //! Activate any joysticks, and generate events for them. virtual bool activateJoysticks(core::array & joystickInfo) _IRR_OVERRIDE_; @@ -176,13 +176,13 @@ namespace irr } //! Returns the current position of the mouse cursor. - virtual const core::position2d& getPosition() + virtual const core::position2d& getPosition(bool updateCursor) _IRR_OVERRIDE_ { return CursorPos; } //! Returns the current position of the mouse cursor. - virtual core::position2d getRelativePosition() + virtual core::position2d getRelativePosition(bool updateCursor) _IRR_OVERRIDE_ { if (!UseReferenceRect) { diff --git a/source/Irrlicht/CIrrDeviceOSX.mm b/source/Irrlicht/CIrrDeviceOSX.mm index 9474646c..d11a47e1 100644 --- a/source/Irrlicht/CIrrDeviceOSX.mm +++ b/source/Irrlicht/CIrrDeviceOSX.mm @@ -1222,7 +1222,7 @@ void CIrrDeviceMacOSX::storeMouseLocation() x = (int)point.x; y = (int)point.y; - const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition(); + const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition(true); if (curr.X != x || curr.Y != y) { // In fullscreen mode, events are not sent regularly so rely on polling @@ -1262,7 +1262,7 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y) c.y = p.y; #ifdef __MAC_10_6 - CGEventRef ev = CGEventCreateMouseEvent(0, kCGEventMouseMoved, c, 0); + CGEventRef ev = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, c, static_cast(kCGEventMouseMoved)); CGEventPost(kCGHIDEventTap, ev); CFRelease(ev); #else diff --git a/source/Irrlicht/CNSOGLManager.h b/source/Irrlicht/CNSOGLManager.h index 42a6317f..c4e38124 100644 --- a/source/Irrlicht/CNSOGLManager.h +++ b/source/Irrlicht/CNSOGLManager.h @@ -52,7 +52,7 @@ namespace video const SExposedVideoData& getContext() const; //! Change render context, disable old and activate new defined by videoData - bool activateContext(const SExposedVideoData& videoData); + bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) _IRR_OVERRIDE_; // Swap buffers. bool swapBuffers(); @@ -61,7 +61,7 @@ namespace video SIrrlichtCreationParameters Params; SExposedVideoData PrimaryContext; SExposedVideoData CurrentContext; - + NSOpenGLPixelFormat* PixelFormat; }; } diff --git a/source/Irrlicht/CNSOGLManager.mm b/source/Irrlicht/CNSOGLManager.mm index db673a11..3409a3ef 100644 --- a/source/Irrlicht/CNSOGLManager.mm +++ b/source/Irrlicht/CNSOGLManager.mm @@ -51,12 +51,12 @@ bool CNSOGLManager::generateSurface() NSOpenGLPFANoRecovery, NSOpenGLPFAAccelerated, NSOpenGLPFADoubleBuffer, - NSOpenGLPFADepthSize, depthSize, + NSOpenGLPFADepthSize, static_cast(depthSize), NSOpenGLPFAColorSize, Params.Bits, - NSOpenGLPFAAlphaSize, alphaSize, + NSOpenGLPFAAlphaSize, static_cast(alphaSize), NSOpenGLPFASampleBuffers, 1, NSOpenGLPFASamples, Params.AntiAlias, - NSOpenGLPFAStencilSize, Params.Stencilbuffer ? 1 : 0, + NSOpenGLPFAStencilSize, static_cast(Params.Stencilbuffer ? 1 : 0), //NSOpenGLPFAFullScreen, 0 }; @@ -188,8 +188,9 @@ const SExposedVideoData& CNSOGLManager::getContext() const return CurrentContext; } -bool CNSOGLManager::activateContext(const SExposedVideoData& videoData) +bool CNSOGLManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) { + //TODO: handle restorePrimaryOnZero if (videoData.OpenGLOSX.Context) { if ((NSOpenGLContext*)videoData.OpenGLOSX.Context != [NSOpenGLContext currentContext])