mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 06:47:19 +00:00
[client] fixed incorrect usage of glXWaitVideoSyncSGI
This commit is contained in:
parent
7574e03d86
commit
5863160c69
@ -18,7 +18,6 @@
|
||||
|
||||
static PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI = NULL;
|
||||
static PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI = NULL;
|
||||
static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL;
|
||||
|
||||
struct LGR_OpenGL
|
||||
{
|
||||
@ -100,9 +99,8 @@ bool lgr_opengl_initialize(void ** opaque, const LG_RendererParams params, const
|
||||
{
|
||||
glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC )glXGetProcAddress((const GLubyte *)"glXGetVideoSyncSGI" );
|
||||
glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glXGetProcAddress((const GLubyte *)"glXWaitVideoSyncSGI");
|
||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC )glXGetProcAddress((const GLubyte *)"glXSwapIntervalSGI" );
|
||||
|
||||
if (!glXGetVideoSyncSGI || !glXWaitVideoSyncSGI || !glXSwapIntervalSGI)
|
||||
if (!glXGetVideoSyncSGI || !glXWaitVideoSyncSGI)
|
||||
{
|
||||
glXGetVideoSyncSGI = NULL;
|
||||
DEBUG_ERROR("Failed to get proc addresses");
|
||||
@ -212,6 +210,7 @@ bool lgr_opengl_initialize(void ** opaque, const LG_RendererParams params, const
|
||||
|
||||
this->resizeWindow = true;
|
||||
this->drawStart = nanotime();
|
||||
glXGetVideoSyncSGI(&this->gpuFrameCount);
|
||||
|
||||
// copy the format into the local storage
|
||||
memcpy(&this->format, &format, sizeof(LG_RendererFormat));
|
||||
@ -427,14 +426,7 @@ bool lgr_opengl_render(void * opaque, const uint8_t * data, bool resample)
|
||||
|
||||
// wait until the frame has been presented, this is to avoid the video card
|
||||
// buffering frames, we would rather skip a frame then fall behind the guest
|
||||
uint count;
|
||||
glXGetVideoSyncSGI(&count);
|
||||
if (this->gpuFrameCount == count)
|
||||
{
|
||||
uint remainder;
|
||||
glXWaitVideoSyncSGI(count, 1, &remainder);
|
||||
}
|
||||
this->gpuFrameCount = count + 1;
|
||||
glXWaitVideoSyncSGI(1, 0, &this->gpuFrameCount);
|
||||
|
||||
const uint64_t t = nanotime();
|
||||
this->renderTime += t - this->lastFrameTime;
|
||||
|
Loading…
Reference in New Issue
Block a user