浏览代码

cocoa: Fix OpenGL deprecation warning.

Ryan C. Gordon 3 年之前
父节点
当前提交
7ebdae5dc9
共有 1 个文件被更改,包括 6 次插入6 次删除
  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) {