diff --git a/client/src/main.c b/client/src/main.c index 6ff0144d..cf0891d2 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -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 diff --git a/client/src/main.h b/client/src/main.h index 18ea70fd..68df03fc 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -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;