OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Attributes
WGEAnimationFrameTimer Class Reference

Frame-based animation timing. More...

#include <WGEAnimationFrameTimer.h>

+ Inheritance diagram for WGEAnimationFrameTimer:

List of all members.

Public Types

typedef boost::shared_ptr
< WGEAnimationFrameTimer
SPtr
 Convenience typedef for a shared_ptr.
typedef boost::shared_ptr
< const WGEAnimationFrameTimer
ConstSPtr
 Convenience typedef for a const shared_ptr.

Public Member Functions

 WGEAnimationFrameTimer (float framesPerSecond=24.0)
 Constructs a frame based animation timer.
virtual ~WGEAnimationFrameTimer ()
 Destructor.
virtual void reset ()
 Resets the start-tick.
virtual double elapsed () const
 Returns the elapsed time since the last reset in seconds with milliseconds precision.
virtual void tick ()
 Increments frame count.

Private Attributes

size_t m_tick
 The current tick value.
double m_framesPerSecond
 The number of frames per second.

Detailed Description

Frame-based animation timing.

Definition at line 37 of file WGEAnimationFrameTimer.h.


Member Typedef Documentation

typedef boost::shared_ptr< const WGEAnimationFrameTimer > WGEAnimationFrameTimer::ConstSPtr

Convenience typedef for a const shared_ptr.

Reimplemented from WTimer.

Definition at line 48 of file WGEAnimationFrameTimer.h.

Convenience typedef for a shared_ptr.

Reimplemented from WTimer.

Definition at line 43 of file WGEAnimationFrameTimer.h.


Constructor & Destructor Documentation

WGEAnimationFrameTimer::WGEAnimationFrameTimer ( float  framesPerSecond = 24.0) [explicit]

Constructs a frame based animation timer.

The specified number of frames is used to convert the number of frames to a time.

Parameters:
framesPerSecondframes per second.

Definition at line 27 of file WGEAnimationFrameTimer.cpp.

Destructor.

Definition at line 35 of file WGEAnimationFrameTimer.cpp.


Member Function Documentation

double WGEAnimationFrameTimer::elapsed ( ) const [virtual]

Returns the elapsed time since the last reset in seconds with milliseconds precision.

Returns:
elapsed time in seconds with millisecond precision.

Implements WTimer.

Definition at line 45 of file WGEAnimationFrameTimer.cpp.

References m_framesPerSecond, and m_tick.

void WGEAnimationFrameTimer::reset ( ) [virtual]

Resets the start-tick.

Implements WTimer.

Definition at line 40 of file WGEAnimationFrameTimer.cpp.

References m_tick.

void WGEAnimationFrameTimer::tick ( ) [virtual]

Increments frame count.

Definition at line 50 of file WGEAnimationFrameTimer.cpp.

References m_tick.


Member Data Documentation

The number of frames per second.

Definition at line 88 of file WGEAnimationFrameTimer.h.

Referenced by elapsed().

The current tick value.

Definition at line 83 of file WGEAnimationFrameTimer.h.

Referenced by elapsed(), reset(), and tick().


The documentation for this class was generated from the following files: