Merge pull request #105 from degasus/vsyncFix
Fetch swapInterval function pointer after binding a context
This commit is contained in:
commit
b1e94cbbb5
|
@ -110,7 +110,6 @@ bool cInterfaceGLX::Create(void *&window_handle)
|
|||
PanicAlert("Unable to create GLX context.");
|
||||
return false;
|
||||
}
|
||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)GLInterface->GetFuncAddress("glXSwapIntervalSGI");
|
||||
|
||||
GLWin.x = _tx;
|
||||
GLWin.y = _ty;
|
||||
|
@ -131,7 +130,14 @@ bool cInterfaceGLX::MakeCurrent()
|
|||
XMoveResizeWindow(GLWin.evdpy, GLWin.win, GLWin.x, GLWin.y,
|
||||
GLWin.width, GLWin.height);
|
||||
#endif
|
||||
return glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
|
||||
|
||||
bool success = glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
|
||||
if (success)
|
||||
{
|
||||
// load this function based on the current bound context
|
||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)GLInterface->GetFuncAddress("glXSwapIntervalSGI");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
bool cInterfaceGLX::ClearCurrent()
|
||||
|
|
|
@ -128,9 +128,6 @@ bool cInterfaceWGL::Create(void *&window_handle)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Grab the swap interval function pointer
|
||||
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)GLInterface->GetFuncAddress("wglSwapIntervalEXT");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -141,7 +138,13 @@ bool cInterfaceWGL::MakeCurrent()
|
|||
|
||||
bool cInterfaceWGL::ClearCurrent()
|
||||
{
|
||||
return wglMakeCurrent(hDC, NULL) ? true : false;
|
||||
bool success = wglMakeCurrent(hDC, NULL) ? true : false;
|
||||
if (success)
|
||||
{
|
||||
// Grab the swap interval function pointer
|
||||
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)GLInterface->GetFuncAddress("wglSwapIntervalEXT");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
// Update window width, size and etc. Called from Render.cpp
|
||||
|
|
Loading…
Reference in New Issue