Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed an issue in InputImpl::getSFOpenGLViewFromSFMLWindow (see issue #782) #792
When a window is created with fullscreen mode (see SFWindowController::setupFullscreenViewTithMode) a NSView called masterview is created with the SFLOpenGLView added as subview of this NSView. This NSView is then set as the window's contentview.
This means that whenever InputImp::getSFOpenGLViewFromSFMLWindow is called during fulllscreen mode it'll try to get the SFOpenGLView from the contentview which fails because it's a regular NSView, not a SFOpenGLView. This fix attempts to get the SFOpenGLView from the contentview's subviews instead of the contentview itself.
referenced this pull request
Feb 4, 2015
I think the if([view isKindOfClass:[NSView class]]) statement I put in is rather redundant so that can be removed (it will always return true). What I'd like to do is check if the window is fullscreen and if that's the case check the view's subviews for an SFOpenGLView instead of doing it after failing to get the SFOpenGLView directly from the view itself. I'm not quite familiar with the SFML internals so I'm having a hard time figuring out how to check if the window is running in fullscreen mode. If anyone has any ideas then please share them.
It might be refactored in the future but for now I think for now it's relatively good and plays nice with the rest of the implementation.
Testing for fullscreen might not be a good idea: I didn't check carefully but it might be problematic when creating a