mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] main: sync to the ups if the ups exceeds minFrameTime
This commit is contained in:
parent
1c8af28f26
commit
8cf444ef31
@ -147,7 +147,7 @@ static int renderThread(void * unused)
|
|||||||
|
|
||||||
/* start up the fps timer */
|
/* start up the fps timer */
|
||||||
LGTimer * fpsTimer;
|
LGTimer * fpsTimer;
|
||||||
if (!lgCreateTimer(1000, fpsTimerFn, NULL, &fpsTimer))
|
if (!lgCreateTimer(500, fpsTimerFn, NULL, &fpsTimer))
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("Failed to create the fps timer");
|
DEBUG_ERROR("Failed to create the fps timer");
|
||||||
return 1;
|
return 1;
|
||||||
@ -165,7 +165,9 @@ static int renderThread(void * unused)
|
|||||||
{
|
{
|
||||||
if (g_params.fpsMin != 0)
|
if (g_params.fpsMin != 0)
|
||||||
{
|
{
|
||||||
if (!lgWaitEventAbs(e_frame, &time))
|
float ups = atomic_load_explicit(&g_state.ups, memory_order_relaxed);
|
||||||
|
|
||||||
|
if (!lgWaitEventAbs(e_frame, &time) || ups > g_params.fpsMin)
|
||||||
{
|
{
|
||||||
/* only update the time if we woke up early */
|
/* only update the time if we woke up early */
|
||||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||||
|
Loading…
Reference in New Issue
Block a user