A... periodic timer. More...
#include <gui_editbox.hpp>
Public Types | |
| enum | start_type { START_PAUSED, START_NOW, START_FIRST_TICK } |
Public Member Functions | |
| periodic_timer (const double &dDuration, start_type mType, bool bTicks) | |
| Default constructor. | |
| const double & | get_elapsed () |
| Returns the time elapsed since the last tick. | |
| const double & | get_period () const |
| Returns the period of the periodic_timer. | |
| bool | is_paused () const |
| Cheks if this periodic_timer is paused. | |
| bool | ticks () |
| Checks if the timer's period has been reached. | |
| void | stop () |
| Pauses the timer and resets it. | |
| void | start () |
| Starts the timer but doesn't reset it. | |
| void | pause () |
| Pauses the timer. | |
| void | zero () |
| Resets the timer but doesn't pause it. | |
| void | update (double dDelta) |
| Updates this timer (adds time). | |
A... periodic timer.
This timer is meant to tick periodicaly, so you can use it for any periodic event such as key repetition or a count down.
Definition at line 21 of file gui_editbox.hpp.
| START_PAUSED |
The timer will start if you call Start(). |
| START_NOW |
The timer starts immediatly after it is created. |
| START_FIRST_TICK |
The timer will start when you first call Ticks(). |
Definition at line 25 of file gui_editbox.hpp.
| gui::periodic_timer::periodic_timer | ( | const double & | dDuration, | |
| start_type | mType, | |||
| bool | bTicks | |||
| ) |
Default constructor.
| dDuration | The time interval between each tick | |
| mType | See TimerType | |
| bTicks | The timer ticks immediately |
Definition at line 1233 of file gui_editbox.cpp.
| const double & gui::periodic_timer::get_elapsed | ( | ) |
Returns the time elapsed since the last tick.
Definition at line 1241 of file gui_editbox.cpp.
| const double & gui::periodic_timer::get_period | ( | ) | const |
Returns the period of the periodic_timer.
Definition at line 1246 of file gui_editbox.cpp.
| bool gui::periodic_timer::is_paused | ( | ) | const |
Cheks if this periodic_timer is paused.
Definition at line 1251 of file gui_editbox.cpp.
| void gui::periodic_timer::pause | ( | ) |
Pauses the timer.
Definition at line 1281 of file gui_editbox.cpp.
| void gui::periodic_timer::start | ( | ) |
Starts the timer but doesn't reset it.
Definition at line 1286 of file gui_editbox.cpp.
| void gui::periodic_timer::stop | ( | ) |
Pauses the timer and resets it.
Definition at line 1275 of file gui_editbox.cpp.
| bool gui::periodic_timer::ticks | ( | ) |
Checks if the timer's period has been reached.
Definition at line 1256 of file gui_editbox.cpp.
| void gui::periodic_timer::update | ( | double | dDelta | ) |
Updates this timer (adds time).
| dDelta | The time elapsed since last update |
Definition at line 1296 of file gui_editbox.cpp.
| void gui::periodic_timer::zero | ( | ) |
Resets the timer but doesn't pause it.
Definition at line 1291 of file gui_editbox.cpp.
1.6.1