mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[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:
parent
f4df690d9f
commit
31249da533
@ -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)
|
||||
|
@ -60,6 +60,7 @@ struct AppState
|
||||
bool modShift;
|
||||
bool modAlt;
|
||||
bool modSuper;
|
||||
uint64_t lastImGuiFrame;
|
||||
|
||||
bool alertShow;
|
||||
char * alertMessage;
|
||||
|
Loading…
Reference in New Issue
Block a user