Manage timing and program pause. More...

#include <NRE_Clock.hpp>

Public Member Functions

 Clock ()
 
 Clock (Clock const &c)=default
 
 Clock (Clock &&c)=default
 
 ~Clock ()=default
 
TimeStep const & getTimestep () const
 
float getDelta () const
 
void update ()
 
void updateAndSleep (TimeStep const &time)
 
void sleep (TimeStep const &time)
 
void showFPS ()
 
void hideFPS ()
 
Clockoperator= (Clock const &c)=default
 
Clockoperator= (Clock &&c)=default
 
Utility::String toString () const
 

Static Public Attributes

static float TIMESTEP = 0
 

Detailed Description

Manage timing and program pause.

Constructor & Destructor Documentation

NRE::Time::Clock::Clock ( )

Default constructor

NRE::Time::Clock::Clock ( Clock const &  c)
default

Copy c into this

Parameters
cthe clock to copy
NRE::Time::Clock::Clock ( Clock &&  c)
default

Move c into this

Parameters
cthe clock to move
NRE::Time::Clock::~Clock ( )
default

Clock Deconstructor

Member Function Documentation

float NRE::Time::Clock::getDelta ( ) const
Returns
the timestep with float format
TimeStep const& NRE::Time::Clock::getTimestep ( ) const
Returns
the clock's timestep
void NRE::Time::Clock::hideFPS ( )

Disable fps display

Clock& NRE::Time::Clock::operator= ( Clock const &  c)
default

Copy assignment of c into this

Parameters
cthe clock to copy into this
Returns
the reference of himself
Clock& NRE::Time::Clock::operator= ( Clock &&  c)
default

Move assignment of c into this, leaving c empty

Parameters
cthe clock to move into this
Returns
the reference of himself
void NRE::Time::Clock::showFPS ( )

Enable fps display

void NRE::Time::Clock::sleep ( TimeStep const &  time)

Sleep for a given time

Parameters
timethe timestep to sleep
String NRE::Time::Clock::toString ( ) const

Convert the clock into a string

Returns
the converted clock
void NRE::Time::Clock::update ( )

Update the clock

void NRE::Time::Clock::updateAndSleep ( TimeStep const &  time)

Update the clock and sleep if the timestep is lesser than the given limit

Parameters
timethe minimum timestep

Member Data Documentation

float NRE::Time::Clock::TIMESTEP = 0
static

The application's delta


The documentation for this class was generated from the following files:
  • /mnt/c/Users/abell/Documents/GitHub/NRE-System/src/System/Time/Clock/NRE_Clock.hpp
  • /mnt/c/Users/abell/Documents/GitHub/NRE-System/src/System/Time/Clock/NRE_Clock.cpp