cocoa: Fix OpenGL deprecation warning.

This commit is contained in:
Ryan C. Gordon 2022-11-16 11:45:41 -05:00
parent 7c760f7f79
commit 7ebdae5dc9
1 changed files with 6 additions and 6 deletions

View File

@ -260,12 +260,6 @@ static void ConvertNSRect(NSScreen *screen, BOOL fullscreen, NSRect *r)
static void
ScheduleContextUpdates(SDL_WindowData *data)
{
NSOpenGLContext *currentContext;
NSMutableArray *contexts;
if (!data || !data.nscontexts) {
return;
}
/* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */
#if SDL_VIDEO_OPENGL
@ -274,6 +268,12 @@ ScheduleContextUpdates(SDL_WindowData *data)
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
NSOpenGLContext *currentContext;
NSMutableArray *contexts;
if (!data || !data.nscontexts) {
return;
}
currentContext = [NSOpenGLContext currentContext];
contexts = data.nscontexts;
@synchronized (contexts) {