Fixed Mac compile errors when OpenGL is disabled.

This commit is contained in:
Aaron Barany 2022-10-01 16:10:46 -07:00 committed by Sam Lantinga
parent c29629a5ef
commit 5e654a4bf2
1 changed files with 8 additions and 0 deletions

View File

@ -267,6 +267,8 @@ ScheduleContextUpdates(SDL_WindowData *data)
} }
/* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */
#if SDL_VIDEO_OPENGL
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdeprecated-declarations"
@ -287,6 +289,8 @@ ScheduleContextUpdates(SDL_WindowData *data)
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic pop #pragma clang diagnostic pop
#endif #endif
#endif /* SDL_VIDEO_OPENGL */
} }
/* !!! FIXME: this should use a hint callback. */ /* !!! FIXME: this should use a hint callback. */
@ -2350,11 +2354,15 @@ Cocoa_DestroyWindow(_THIS, SDL_Window * window)
[data.nswindow close]; [data.nswindow close];
} }
#if SDL_VIDEO_OPENGL
contexts = [data.nscontexts copy]; contexts = [data.nscontexts copy];
for (SDLOpenGLContext *context in contexts) { for (SDLOpenGLContext *context in contexts) {
/* Calling setWindow:NULL causes the context to remove itself from the context list. */ /* Calling setWindow:NULL causes the context to remove itself from the context list. */
[context setWindow:NULL]; [context setWindow:NULL];
} }
#endif /* SDL_VIDEO_OPENGL */
} }
window->driverdata = NULL; window->driverdata = NULL;
}} }}