mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +00:00
[client] more fps limiter fixes
This commit is contained in:
parent
9b6174793a
commit
60f665a65c
@ -175,7 +175,7 @@ static struct Option options[] =
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
.module = "win",
|
.module = "win",
|
||||||
.name = "fpsMinimum",
|
.name = "fpsMin",
|
||||||
.description = "Frame rate minimum (0 = disable - not recommended, -1 = auto detect)",
|
.description = "Frame rate minimum (0 = disable - not recommended, -1 = auto detect)",
|
||||||
.shortopt = 'K',
|
.shortopt = 'K',
|
||||||
.type = OPTION_TYPE_INT,
|
.type = OPTION_TYPE_INT,
|
||||||
|
@ -191,17 +191,20 @@ static int renderThread(void * unused)
|
|||||||
state.resizeDone = true;
|
state.resizeDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_gettime(CLOCK_REALTIME, &time);
|
if (state.frameTime > 0)
|
||||||
uint64_t nsec = time.tv_nsec + state.frameTime;
|
|
||||||
if(nsec > 1e9)
|
|
||||||
{
|
{
|
||||||
time.tv_nsec = nsec - 1e9;
|
clock_gettime(CLOCK_REALTIME, &time);
|
||||||
++time.tv_sec;
|
uint64_t nsec = time.tv_nsec + state.frameTime;
|
||||||
}
|
if(nsec > 1e9)
|
||||||
else
|
{
|
||||||
time.tv_nsec = nsec;
|
time.tv_nsec = nsec - 1e9;
|
||||||
|
++time.tv_sec;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
time.tv_nsec = nsec;
|
||||||
|
|
||||||
lgWaitEventAbs(e_frame, &time);
|
lgWaitEventAbs(e_frame, &time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.running = false;
|
state.running = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user