mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user