Explorar o código

Merge pull request #1447 from blackberry/master

Merge to next
Sean Taylor %!s(int64=12) %!d(string=hai) anos
pai
achega
ac717348d6
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      gameplay/src/PlatformWindows.cpp

+ 9 - 2
gameplay/src/PlatformWindows.cpp

@@ -760,7 +760,10 @@ bool initializeGL(WindowCreationParams* params)
     }
     }
 
 
     // Vertical sync.
     // Vertical sync.
-    wglSwapIntervalEXT(__vsync ? 1 : 0);
+    if (wglSwapIntervalEXT) 
+        wglSwapIntervalEXT(__vsync ? 1 : 0);
+    else 
+        __vsync = false;
 
 
     // Some old graphics cards support EXT_framebuffer_object instead of ARB_framebuffer_object.
     // Some old graphics cards support EXT_framebuffer_object instead of ARB_framebuffer_object.
     // Patch ARB_framebuffer_object functions to EXT_framebuffer_object ones since semantic is same.
     // Patch ARB_framebuffer_object functions to EXT_framebuffer_object ones since semantic is same.
@@ -1073,8 +1076,12 @@ bool Platform::isVsync()
 
 
 void Platform::setVsync(bool enable)
 void Platform::setVsync(bool enable)
 {
 {
-     wglSwapIntervalEXT(enable ? 1 : 0);
     __vsync = enable;
     __vsync = enable;
+
+    if (wglSwapIntervalEXT) 
+        wglSwapIntervalEXT(__vsync ? 1 : 0);
+    else 
+        __vsync = false;
 }
 }
 
 
 void Platform::swapBuffers()
 void Platform::swapBuffers()