Skip to content

Commit

Permalink
OSX: use native method to hide the cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
MoNTE48 committed Sep 16, 2022
1 parent f0c4895 commit 052c05a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions source/Irrlicht/CIrrDeviceSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,20 +451,27 @@ void CIrrDeviceSDL::updateNativeScale()

void CIrrDeviceSDL::setCursorVisible(bool visible)
{
#if defined(_IRR_OSX_PLATFORM_)
if (visible)
CGDisplayShowCursor(CGMainDisplayID());
else
CGDisplayHideCursor(CGMainDisplayID());
#else
if (visible)
{
SDL_ShowCursor(SDL_ENABLE);
#if defined(_IRR_OSX_PLATFORM_)
NSApp.presentationOptions &= ~NSApplicationPresentationDisableCursorLocationAssistance;
#endif
//#if defined(_IRR_OSX_PLATFORM_)
// NSApp.presentationOptions &= ~NSApplicationPresentationDisableCursorLocationAssistance;
//#endif
}
else
{
SDL_ShowCursor(SDL_DISABLE);
#if defined(_IRR_OSX_PLATFORM_)
NSApp.presentationOptions |= NSApplicationPresentationDisableCursorLocationAssistance;
#endif
//#if defined(_IRR_OSX_PLATFORM_)
// NSApp.presentationOptions |= NSApplicationPresentationDisableCursorLocationAssistance;
//#endif
}
#endif
}

//! create the driver
Expand Down

0 comments on commit 052c05a

Please sign in to comment.