[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 authored and Geoffrey McRae committed 2021-08-31 08:16:07 +10:00
1 parent f4df690d9f
commit 31249da533
2 files changed
+5

No files matched your search

+4
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)
+1
View File
@@ -60,6 +60,7 @@ struct AppState
bool modShift;
bool modAlt;
bool modSuper;
uint64_t lastImGuiFrame;
bool alertShow;
char * alertMessage;