[client] imgui: run animations at consistent speeds

Currently, this is visible through how fast the cursor blinks, with it
blinking faster at higher refresh rates. This commit makes the timing
consistent.
This commit is contained in:
Quantum 2021-08-30 06:48:41 -04:00 committed by Geoffrey McRae
parent f4df690d9f
commit 31249da533
2 changed files with 5 additions and 0 deletions

View File

@ -811,6 +811,10 @@ int app_renderOverlay(struct Rect * rects, int maxRects)
g_state.io->KeyAlt = g_state.modAlt;
g_state.io->KeySuper = g_state.modSuper;
uint64_t now = nanotime();
g_state.io->DeltaTime = (now - g_state.lastImGuiFrame) * 1e-9f;
g_state.lastImGuiFrame = now;
igNewFrame();
if (g_state.overlayInput)

View File

@ -60,6 +60,7 @@ struct AppState
bool modShift;
bool modAlt;
bool modSuper;
uint64_t lastImGuiFrame;
bool alertShow;
char * alertMessage;