Browse Source

Merge pull request #1014 from Lopuska/patch-1

vSync on opengl
Luis Anton Rebollo 10 years ago
parent
commit
098fa19abb

+ 1 - 1
Engine/source/gfx/gl/gfxGLDevice.cpp

@@ -179,7 +179,7 @@ void GFXGLDevice::initGLState()
    }
 #endif
 
-   PlatformGL::setVSync(0);
+   PlatformGL::setVSync(smDisableVSync ? 0 : 1);
 
    //OpenGL 3 need a binded VAO for render
    GLuint vao;

+ 0 - 2
Engine/source/gfx/gl/win32/gfxGLDevice.win.cpp

@@ -297,8 +297,6 @@ void GFXGLDevice::init( const GFXVideoMode &mode, PlatformWindow *window )
 
    loadGLCore();
    loadGLExtensions(hdcGL);
-
-   wglSwapIntervalEXT(0);
    
    // It is very important that extensions be loaded
    // before we call initGLState()

+ 5 - 2
Engine/source/platformWin32/WinPlatformGL.cpp

@@ -5,7 +5,10 @@
 
 void PlatformGL::setVSync(const int i)
 {
-   wglSwapIntervalEXT( i );
+    if (WGLEW_EXT_swap_control)
+    {
+        wglSwapIntervalEXT(i);
+    }
 }
 
-#endif
+#endif