mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] fixed out by one error on frame sleep sync
This commit is contained in:
parent
38d458ac7d
commit
7574e03d86
@ -420,9 +420,10 @@ bool lgr_opengl_render(void * opaque, const uint8_t * data, bool resample)
|
|||||||
if (this->fpsTexture)
|
if (this->fpsTexture)
|
||||||
glCallList(this->fpsList);
|
glCallList(this->fpsList);
|
||||||
|
|
||||||
|
glFlush();
|
||||||
|
|
||||||
++this->frameCount;
|
++this->frameCount;
|
||||||
SDL_GL_SwapWindow(this->params.window);
|
SDL_GL_SwapWindow(this->params.window);
|
||||||
glFlush();
|
|
||||||
|
|
||||||
// wait until the frame has been presented, this is to avoid the video card
|
// 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
|
// buffering frames, we would rather skip a frame then fall behind the guest
|
||||||
@ -432,10 +433,8 @@ bool lgr_opengl_render(void * opaque, const uint8_t * data, bool resample)
|
|||||||
{
|
{
|
||||||
uint remainder;
|
uint remainder;
|
||||||
glXWaitVideoSyncSGI(count, 1, &remainder);
|
glXWaitVideoSyncSGI(count, 1, &remainder);
|
||||||
this->gpuFrameCount = count + 1;
|
|
||||||
}
|
}
|
||||||
else
|
this->gpuFrameCount = count + 1;
|
||||||
this->gpuFrameCount = count;
|
|
||||||
|
|
||||||
const uint64_t t = nanotime();
|
const uint64_t t = nanotime();
|
||||||
this->renderTime += t - this->lastFrameTime;
|
this->renderTime += t - this->lastFrameTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user