瀏覽代碼

Don't incorrectly report success for negative swap intervals on Mac OS X.

Ryan C. Gordon 12 年之前
父節點
當前提交
bfe1b1d066
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/video/cocoa/SDL_cocoaopengl.m

+ 4 - 0
src/video/cocoa/SDL_cocoaopengl.m

@@ -302,6 +302,10 @@ Cocoa_GL_SetSwapInterval(_THIS, int interval)
     GLint value;
     GLint value;
     int status;
     int status;
 
 
+    if (interval < 0) {  /* no extension for this on Mac OS X at the moment. */
+        return SDL_SetError("Late swap tearing currently unsupported");
+    }
+
     pool = [[NSAutoreleasePool alloc] init];
     pool = [[NSAutoreleasePool alloc] init];
 
 
     nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext();
     nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext();