diff options
author | James Cowgill <jcowgill@debian.org> | 2018-05-15 13:58:15 +0100 |
---|---|---|
committer | James Cowgill <jcowgill@debian.org> | 2018-05-15 13:58:15 +0100 |
commit | b175eed3ca950204c9b52fdcebc897f337b7bf19 (patch) | |
tree | 0f50d921750c957f11bda18abc83f9228d010902 /src/SFML/Window/OSX/SFOpenGLView+mouse.mm | |
parent | 31394fcd65a10f2d2c51c3d27afff5367bded901 (diff) |
New upstream version 2.5.0+dfsg
Diffstat (limited to 'src/SFML/Window/OSX/SFOpenGLView+mouse.mm')
-rw-r--r-- | src/SFML/Window/OSX/SFOpenGLView+mouse.mm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/SFML/Window/OSX/SFOpenGLView+mouse.mm b/src/SFML/Window/OSX/SFOpenGLView+mouse.mm index fa65aa6..4b23042 100644 --- a/src/SFML/Window/OSX/SFOpenGLView+mouse.mm +++ b/src/SFML/Window/OSX/SFOpenGLView+mouse.mm @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2017 Marco Antognini (antognini.marco@gmail.com), +// Copyright (C) 2007-2018 Marco Antognini (antognini.marco@gmail.com), // Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. @@ -41,6 +41,25 @@ @implementation SFOpenGLView (mouse) //////////////////////////////////////////////////////// +-(void)setCursor:(NSCursor*)cursor +{ + m_cursor = cursor; + + // indirect call to resetCursorRects to set the cursor + [self.window invalidateCursorRectsForView:self]; +} + + +//////////////////////////////////////////////////////// +-(void)resetCursorRects +{ + // addCursorRect:cursor: has to be called from within this function! + [self addCursorRect:[self frame] cursor:m_cursor]; + [m_cursor setOnMouseEntered:YES]; +} + + +//////////////////////////////////////////////////////// -(BOOL)isMouseInside { NSPoint relativeToWindow = [[self window] mouseLocationOutsideOfEventStream]; |