![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
Provides high-resolution timing for frame updates. More...
#include <app_clock.hpp>
Public Member Functions | |
| AppClock () | |
| Constructs a new clock initialized with the current time. | |
| AppClock (AppClock const &)=default | |
| AppClock & | operator= (AppClock const &)=default |
| AppClock (AppClock &&)=default | |
| AppClock & | operator= (AppClock &&)=default |
| ~AppClock ()=default | |
| const std::chrono::high_resolution_clock::time_point & | StartTime () const |
| Returns the timestamp when the clock was started. | |
| const std::chrono::high_resolution_clock::time_point & | CurrentTime () const |
| Returns the most recent recorded time (current frame). | |
| const std::chrono::high_resolution_clock::time_point & | LastTime () const |
| Returns the time recorded at the previous frame. | |
| void | Reset () |
| Resets the clock to the current system time. | |
| void | UpdateAppTime (AppTime &appTime) |
| Updates the given AppTime instance with elapsed and total durations. | |
Provides high-resolution timing for frame updates.
AppClock tracks time since the application started and between frames. Each call to UpdateAppTime() updates an AppTime instance with new total and elapsed durations.
Typical usage:
Definition at line 49 of file app_clock.hpp.
| rendering_engine::AppClock::AppClock | ( | ) |
Constructs a new clock initialized with the current time.
Definition at line 7 of file app_clock.cpp.
|
default |
|
default |
|
default |
| const std::chrono::high_resolution_clock::time_point & rendering_engine::AppClock::CurrentTime | ( | ) | const |
Returns the most recent recorded time (current frame).
Definition at line 21 of file app_clock.cpp.
| const std::chrono::high_resolution_clock::time_point & rendering_engine::AppClock::LastTime | ( | ) | const |
Returns the time recorded at the previous frame.
Definition at line 26 of file app_clock.cpp.
| void rendering_engine::AppClock::Reset | ( | ) |
Resets the clock to the current system time.
Definition at line 31 of file app_clock.cpp.
| const std::chrono::high_resolution_clock::time_point & rendering_engine::AppClock::StartTime | ( | ) | const |
Returns the timestamp when the clock was started.
Definition at line 16 of file app_clock.cpp.
| void rendering_engine::AppClock::UpdateAppTime | ( | AppTime & | appTime | ) |
Updates the given AppTime instance with elapsed and total durations.
Calculates the time difference between the last and current frame, updates internal state, and synchronizes AppTime accordingly.
| appTime | Reference to the AppTime instance to update. |
Definition at line 38 of file app_clock.cpp.