Fixed Mac compile errors when OpenGL is disabled.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 02c01bd..fa00968 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -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. */
+ #if SDL_VIDEO_OPENGL
+
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -287,6 +289,8 @@ ScheduleContextUpdates(SDL_WindowData *data)
#ifdef __clang__
#pragma clang diagnostic pop
#endif
+
+ #endif /* SDL_VIDEO_OPENGL */
}
/* !!! FIXME: this should use a hint callback. */
@@ -2350,11 +2354,15 @@ Cocoa_DestroyWindow(_THIS, SDL_Window * window)
[data.nswindow close];
}
+ #if SDL_VIDEO_OPENGL
+
contexts = [data.nscontexts copy];
for (SDLOpenGLContext *context in contexts) {
/* Calling setWindow:NULL causes the context to remove itself from the context list. */
[context setWindow:NULL];
}
+
+ #endif /* SDL_VIDEO_OPENGL */
}
window->driverdata = NULL;
}}