1 #ifndef LXGUI_UTILS_PERIODIC_TIMER_HPP
2 #define LXGUI_UTILS_PERIODIC_TIMER_HPP
4 #include "lxgui/lxgui.hpp"
76 double elapsed_ = 0.0;
77 double duration_ = 0.0;
79 bool first_tick_ =
true;
void stop()
Pauses the timer and resets it.
periodic_timer(double duration, start_type type, bool ticks_now)
Default constructor.
void pause()
Pauses the timer.
bool is_paused() const
Cheks if this periodic_timer is paused.
double get_elapsed() const
Returns the time elapsed since the last tick.
@ first_tick
The timer will start when you first call ticks()
@ now
The timer starts immediatly after it is created.
@ paused
The timer will start if you call start()
void zero()
Resets the timer but doesn't pause it.
bool ticks()
Checks if the timer's period has been reached.
void update(double delta)
Updates this timer (adds time).
double get_period() const
Returns the period of the periodic_timer.
void start()
Starts the timer but doesn't reset it.