TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_frame_clock.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5namespace tachyon
6{
9
17 {
18 public:
21 void Tick(int64_t nowNanos, float refreshHz);
22
24 double Seconds() const { return m_seconds; }
26 double DeltaSeconds() const { return m_deltaSeconds; }
27
28 private:
29 int64_t m_originNanos = 0;
30 bool m_started = false;
31 double m_seconds = 0.0;
32 double m_deltaSeconds = 0.0;
33 };
34
35}
Animation time locked to the display refresh.
Definition gui_frame_clock.h:17
double Seconds() const
Seconds since the first Tick.
Definition gui_frame_clock.h:24
double DeltaSeconds() const
Seconds the last Tick advanced; 0 on the first.
Definition gui_frame_clock.h:26
void Tick(int64_t nowNanos, float refreshHz)
Advances the clock; call once per frame, before anything reads the time.
Definition gui_logging.h:24