Fixes for building on Mac with OpenGL disabled.

This commit is contained in:
Aaron Barany 2023-01-28 16:05:11 -08:00 committed by Sam Lantinga
parent df7639f100
commit 4667d65f77
1 changed files with 10 additions and 0 deletions

View File

@ -919,11 +919,16 @@ static void Cocoa_UpdateClipCursor(SDL_Window *window)
- (void)windowDidChangeScreen:(NSNotification *)aNotification
{
/*printf("WINDOWDIDCHANGESCREEN\n");*/
#if SDL_VIDEO_OPENGL
if (_data && _data.nscontexts) {
for (SDLOpenGLContext *context in _data.nscontexts) {
[context movedToNewScreen];
}
}
#endif /* SDL_VIDEO_OPENGL */
}
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
@ -2316,7 +2321,12 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window *window)
SDL_WindowData *data = (SDL_WindowData *)CFBridgingRelease(window->driverdata);
if (data) {
#if SDL_VIDEO_OPENGL
NSArray *contexts;
#endif /* SDL_VIDEO_OPENGL */
if ([data.listener isInFullscreenSpace]) {
[NSMenu setMenuBarVisible:YES];
}