diff options
Diffstat (limited to 'src/SFML/Window/OSX/InputImpl.mm')
-rw-r--r-- | src/SFML/Window/OSX/InputImpl.mm | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/SFML/Window/OSX/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm index b357c4f..f0e8ee4 100644 --- a/src/SFML/Window/OSX/InputImpl.mm +++ b/src/SFML/Window/OSX/InputImpl.mm @@ -1,8 +1,8 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2014 Marco Antognini (antognini.marco@gmail.com), -// Laurent Gomila (laurent.gom@gmail.com), +// Copyright (C) 2007-2015 Marco Antognini (antognini.marco@gmail.com), +// Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. @@ -70,9 +70,26 @@ SFOpenGLView* getSFOpenGLViewFromSFMLWindow(const Window& window) // Subview doesn't match ? if (![view isKindOfClass:[SFOpenGLView class]]) { - sf::err() << "The content view is not a valid SFOpenGLView" - << std::endl; - view = nil; + if([view isKindOfClass:[NSView class]]) + { + NSArray* subviews = [view subviews]; + for (NSView* subview in subviews) + { + if ([subview isKindOfClass:[SFOpenGLView class]]) + { + view = (SFOpenGLView*)subview; + break; + } + } + + } + else + { + sf::err() << "The content view is not a valid SFOpenGLView" + << std::endl; + + view = nil; + } } } |