mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] main: let the renderer know if it's rendering a whole new frame
While the renderer can internally track this it would be better to simply provide this information to the renderer directly so it can make better decisions on how best to update the screen.
This commit is contained in:
@@ -191,8 +191,14 @@ static int renderThread(void * unused)
|
||||
atomic_compare_exchange_weak(&g_state.lgrResize, &resize, 0);
|
||||
}
|
||||
|
||||
static uint64_t lastFrameCount = 0;
|
||||
const uint64_t frameCount =
|
||||
atomic_load_explicit(&g_state.frameCount, memory_order_relaxed);
|
||||
const bool newFrame = frameCount != lastFrameCount;
|
||||
lastFrameCount = frameCount;
|
||||
|
||||
LG_LOCK(g_state.lgrLock);
|
||||
if (!g_state.lgr->render(g_state.lgrData, g_params.winRotate))
|
||||
if (!g_state.lgr->render(g_state.lgrData, g_params.winRotate, newFrame))
|
||||
{
|
||||
LG_UNLOCK(g_state.lgrLock);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user