mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
OSX/Mouse::GetPosition(relativeTo) no longer complains when the window is closed
This commit is contained in:
parent
535733f5c7
commit
c3e64230cb
@ -61,6 +61,7 @@ SFOpenGLView* GetSFOpenGLViewFromSFMLWindow(const Window& window)
|
||||
|
||||
// Get our SFOpenGLView from ...
|
||||
SFOpenGLView* view = nil;
|
||||
|
||||
if ([nsHandle isKindOfClass:[NSWindow class]]) {
|
||||
// If system handle is a window then from its content view.
|
||||
view = [nsHandle contentView];
|
||||
@ -89,10 +90,13 @@ SFOpenGLView* GetSFOpenGLViewFromSFMLWindow(const Window& window)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
sf::Err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
|
||||
<< "object. This shouldn't happen."
|
||||
<< std::endl;
|
||||
if (nsHandle != 0) {
|
||||
sf::Err() << "The system handle is neither a <NSWindow*> nor <NSView*>"
|
||||
<< "object. This shouldn't happen."
|
||||
<< std::endl;
|
||||
} else {
|
||||
// This probably means the SFML window was previously closed.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user