OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Attributes | List of all members
WGEAnimationFrameTimer Class Reference

Frame-based animation timing. More...

#include <WGEAnimationFrameTimer.h>

+ Inheritance diagram for WGEAnimationFrameTimer:
+ Collaboration diagram for WGEAnimationFrameTimer:

Public Types

typedef std::shared_ptr< WGEAnimationFrameTimerSPtr
 Convenience typedef for a shared_ptr. More...
 
typedef std::shared_ptr< const WGEAnimationFrameTimerConstSPtr
 Convenience typedef for a const shared_ptr. More...
 
- Public Types inherited from WTimer
typedef std::shared_ptr< WTimerSPtr
 Convenience typedef for a shared_ptr. More...
 
typedef std::shared_ptr< const WTimerConstSPtr
 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...
 

Detailed Description

Frame-based animation timing.

Definition at line 38 of file WGEAnimationFrameTimer.h.

Member Typedef Documentation

◆ ConstSPtr

Convenience typedef for a const shared_ptr.

Definition at line 49 of file WGEAnimationFrameTimer.h.

◆ SPtr

Convenience typedef for a shared_ptr.

Definition at line 44 of file WGEAnimationFrameTimer.h.

Constructor & Destructor Documentation

◆ WGEAnimationFrameTimer()

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.

◆ ~WGEAnimationFrameTimer()

WGEAnimationFrameTimer::~WGEAnimationFrameTimer ( )
virtual

Destructor.

Definition at line 35 of file WGEAnimationFrameTimer.cpp.

Member Function Documentation

◆ elapsed()

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.

◆ reset()

void WGEAnimationFrameTimer::reset ( )
virtual

Resets the start-tick.

Implements WTimer.

Definition at line 40 of file WGEAnimationFrameTimer.cpp.

References m_tick.

◆ tick()

void WGEAnimationFrameTimer::tick ( )
virtual

Increments frame count.

Definition at line 50 of file WGEAnimationFrameTimer.cpp.

References m_tick.

Member Data Documentation

◆ m_framesPerSecond

double WGEAnimationFrameTimer::m_framesPerSecond
private

The number of frames per second.

Definition at line 89 of file WGEAnimationFrameTimer.h.

Referenced by elapsed().

◆ m_tick

size_t WGEAnimationFrameTimer::m_tick
private

The current tick value.

Definition at line 84 of file WGEAnimationFrameTimer.h.

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


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