mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-28 00:29:34 +00:00
OpenGL vsync fixes.
This commit is contained in:
parent
38bf2b8175
commit
415f4a046e
7 changed files with 47 additions and 4 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue