|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Animation time locked to the display refresh. More...
#include <gui_core/frame/gui_frame_clock.h>
Public Member Functions | |
| void | Tick (int64_t nowNanos, float refreshHz) |
| Advances the clock; call once per frame, before anything reads the time. | |
| double | Seconds () const |
| Seconds since the first Tick. | |
| double | DeltaSeconds () const |
| Seconds the last Tick advanced; 0 on the first. | |
Animation time locked to the display refresh.
Frames reach the screen on vsyncs, a whole number of refresh periods after the previous one, but the CPU sees those intervals with jitter. The clock advances by whole periods, rounded against the wall clock, so animations step evenly and never drift from real time by more than half a period. Without a known refresh rate it follows the wall clock.
| void tachyon::FrameClock::Tick | ( | int64_t | nowNanos, |
| float | refreshHz ) |
Advances the clock; call once per frame, before anything reads the time.
nowNanos is a monotonic timestamp (SteadyClockNowNanos); refreshHz is 0 when unknown.
|
inline |
Seconds since the first Tick.
|
inline |
Seconds the last Tick advanced; 0 on the first.