![]() |
OpenWalnut
1.5.0dev
|
Frame-based animation timing. More...
#include <WGEAnimationFrameTimer.h>
Inheritance diagram for WGEAnimationFrameTimer:
Collaboration diagram for WGEAnimationFrameTimer:Public Types | |
| typedef std::shared_ptr< WGEAnimationFrameTimer > | SPtr |
| Convenience typedef for a shared_ptr. More... | |
| typedef std::shared_ptr< const WGEAnimationFrameTimer > | ConstSPtr |
| Convenience typedef for a const shared_ptr. More... | |
Public Types inherited from WTimer | |
| typedef std::shared_ptr< WTimer > | SPtr |
| Convenience typedef for a shared_ptr. More... | |
| typedef std::shared_ptr< const WTimer > | ConstSPtr |
| Convenience typedef for a const shared_ptr. More... | |
Public Member Functions | |
| WGEAnimationFrameTimer (float framesPerSecond=24.0) | |
| Constructs a frame based animation timer. More... | |
| virtual | ~WGEAnimationFrameTimer () |
| Destructor. More... | |
| virtual void | reset () |
| Resets the start-tick. More... | |
| virtual double | elapsed () const |
| Returns the elapsed time since the last reset in seconds with milliseconds precision. More... | |
| virtual void | tick () |
| Increments frame count. More... | |
Public Member Functions inherited from WTimer | |
| WTimer () | |
| Constructs a animation timer. More... | |
| virtual | ~WTimer () |
| Destructor. More... | |
Private Attributes | |
| size_t | m_tick |
| The current tick value. More... | |
| double | m_framesPerSecond |
| The number of frames per second. More... | |
Frame-based animation timing.
Definition at line 38 of file WGEAnimationFrameTimer.h.
| typedef std::shared_ptr< const WGEAnimationFrameTimer > WGEAnimationFrameTimer::ConstSPtr |
Convenience typedef for a const shared_ptr.
Definition at line 49 of file WGEAnimationFrameTimer.h.
| typedef std::shared_ptr< WGEAnimationFrameTimer > WGEAnimationFrameTimer::SPtr |
Convenience typedef for a shared_ptr.
Definition at line 44 of file WGEAnimationFrameTimer.h.
|
explicit |
Constructs a frame based animation timer.
The specified number of frames is used to convert the number of frames to a time.
| framesPerSecond | frames per second. |
Definition at line 27 of file WGEAnimationFrameTimer.cpp.
|
virtual |
Destructor.
Definition at line 35 of file WGEAnimationFrameTimer.cpp.
|
virtual |
Returns the elapsed time since the last reset in seconds with milliseconds precision.
Implements WTimer.
Definition at line 45 of file WGEAnimationFrameTimer.cpp.
References m_framesPerSecond, and m_tick.
|
virtual |
Resets the start-tick.
Implements WTimer.
Definition at line 40 of file WGEAnimationFrameTimer.cpp.
References m_tick.
|
virtual |
Increments frame count.
Definition at line 50 of file WGEAnimationFrameTimer.cpp.
References m_tick.
|
private |
The number of frames per second.
Definition at line 89 of file WGEAnimationFrameTimer.h.
Referenced by elapsed().
|
private |
The current tick value.
Definition at line 84 of file WGEAnimationFrameTimer.h.