From 7574e03d862437001f8cb77816c21393ae57ab80 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 11 Dec 2017 04:31:35 +1100 Subject: [PATCH] [client] fixed out by one error on frame sleep sync --- client/renderers/opengl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/renderers/opengl.c b/client/renderers/opengl.c index 6e1c72d1..927bc46d 100644 --- a/client/renderers/opengl.c +++ b/client/renderers/opengl.c @@ -420,9 +420,10 @@ bool lgr_opengl_render(void * opaque, const uint8_t * data, bool resample) if (this->fpsTexture) glCallList(this->fpsList); + glFlush(); + ++this->frameCount; SDL_GL_SwapWindow(this->params.window); - glFlush(); // 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 @@ -432,10 +433,8 @@ bool lgr_opengl_render(void * opaque, const uint8_t * data, bool resample) { uint remainder; glXWaitVideoSyncSGI(count, 1, &remainder); - this->gpuFrameCount = count + 1; } - else - this->gpuFrameCount = count; + this->gpuFrameCount = count + 1; const uint64_t t = nanotime(); this->renderTime += t - this->lastFrameTime;