Browse Source

cocoa: Fix OpenGL deprecation warning.

Ryan C. Gordon 2 years ago
parent
commit
7ebdae5dc9
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/video/cocoa/SDL_cocoawindow.m

+ 6 - 6
src/video/cocoa/SDL_cocoawindow.m

@@ -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) {