OpenGL vsync fixes.

This commit is contained in:
rextimmy 2016-12-23 13:59:55 +10:00
parent 38bf2b8175
commit 415f4a046e
7 changed files with 47 additions and 4 deletions

View file

@ -172,12 +172,21 @@ void GFXGLDevice::initGLState()
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
GLuint vao;
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
}
void GFXGLDevice::vsyncCallback()
{
PlatformGL::setVSync(smDisableVSync ? 0 : 1);
}
GFXGLDevice::GFXGLDevice(U32 adapterIndex) :
mAdapterIndex(adapterIndex),
mNeedUpdateVertexAttrib(false),