[client] main: bump the minimum fps to 60fps when showing the overlay

This commit is contained in:
Geoffrey McRae 2021-07-31 16:19:55 +10:00
parent 3143dc1e84
commit 971e91238a
2 changed files with 8 additions and 2 deletions

View file

@ -174,7 +174,8 @@ static int renderThread(void * unused)
{
/* only update the time if we woke up early */
clock_gettime(CLOCK_MONOTONIC, &time);
tsAdd(&time, g_state.frameTime);
tsAdd(&time, g_state.overlayInput ?
g_state.overlayFrameTime : g_state.frameTime);
}
}
@ -945,6 +946,10 @@ static int lg_run(void)
g_state.frameTime = 1000000000ULL / (unsigned long long)g_params.fpsMin;
}
// when the overlay is shown we should run at a minimum of 60 fps for
// interactivity.
g_state.overlayFrameTime = min(g_state.frameTime, 1000000000ULL / 60ULL);
keybind_register();
// setup the startup condition

View file

@ -109,7 +109,8 @@ struct AppState
LGEvent * frameEvent;
atomic_bool invalidateWindow;
bool formatValid;
atomic_uint_least64_t frameTime;
uint64_t frameTime;
uint64_t overlayFrameTime;
uint64_t lastFrameTime;
bool lastFrameTimeValid;
uint64_t lastRenderTime;