|
@@ -172,12 +172,21 @@ void GFXGLDevice::initGLState()
|
|
|
|
|
|
PlatformGL::setVSync(smDisableVSync ? 0 : 1);
|
|
PlatformGL::setVSync(smDisableVSync ? 0 : 1);
|
|
|
|
|
|
|
|
+ //install vsync callback
|
|
|
|
+ Con::NotifyDelegate clbk(this, &GFXGLDevice::vsyncCallback);
|
|
|
|
+ Con::addVariableNotify("$pref::Video::disableVerticalSync", clbk);
|
|
|
|
+
|
|
//OpenGL 3 need a binded VAO for render
|
|
//OpenGL 3 need a binded VAO for render
|
|
GLuint vao;
|
|
GLuint vao;
|
|
glGenVertexArrays(1, &vao);
|
|
glGenVertexArrays(1, &vao);
|
|
glBindVertexArray(vao);
|
|
glBindVertexArray(vao);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void GFXGLDevice::vsyncCallback()
|
|
|
|
+{
|
|
|
|
+ PlatformGL::setVSync(smDisableVSync ? 0 : 1);
|
|
|
|
+}
|
|
|
|
+
|
|
GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
|
|
GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
|
|
mAdapterIndex(adapterIndex),
|
|
mAdapterIndex(adapterIndex),
|
|
mNeedUpdateVertexAttrib(false),
|
|
mNeedUpdateVertexAttrib(false),
|