Platformer
Platformer
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TimeManager Class Reference

Manages the time and framerate for our game. More...

#include <TimeManager.hpp>

Collaboration diagram for TimeManager:
Collaboration graph

Public Member Functions

void StablizeFramerate ()
 Stabilizes the framerate of the game by calling SDL_Delay.
 
 TimeManager (const TimeManager &)=delete
 Stop the compiler from generating methods to copy the object.
 
TimeManager & operator= (const TimeManager &)=delete
 Stop the compiler from generating methods to copy the object.
 

Static Public Member Functions

static TimeManager & instance ()
 The singleton instance of the TimeManager.
 
static unsigned int DeltaTime ()
 

Private Member Functions

 TimeManager ()
 Constructs a TimeManager.
 
 ~TimeManager ()
 Destructs a TimeManager.
 

Private Attributes

unsigned int lastTick_ = 0
 The last update tick for stabilizing the framerate.
 
unsigned int lastDelta_ = 0
 The change in time based on the last update tick.
 
unsigned int TICKS_PER_FRAME = 16
 The ticks per frame for stabilizing the framerate.
 

Detailed Description

Manages the time and framerate for our game.


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