vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
ven::Clock Class Reference

Class for clock. More...

#include <Clock.hpp>

+ Collaboration diagram for ven::Clock:

Public Member Functions

 Clock ()
 
 ~Clock ()=default
 
 Clock (const Clock &)=delete
 
Clockoperator= (const Clock &)=delete
 
 Clock (Clock &&)=delete
 
Clockoperator= (Clock &&)=delete
 
void start ()
 
void stop ()
 
void resume ()
 
void update ()
 
float getDeltaTime () const
 
float getDeltaTimeMS () const
 
float getFPS () const
 

Static Public Member Functions

static std::chrono::high_resolution_clock::time_point now ()
 

Private Attributes

TimePoint m_startTime
 
TimePoint m_stopTime
 
std::chrono::duration< float > m_deltaTime {0.F}
 
bool m_isStopped {false}
 

Detailed Description

Class for clock.

Definition at line 20 of file Clock.hpp.

Constructor & Destructor Documentation

◆ Clock() [1/3]

ven::Clock::Clock ( )
inline

Definition at line 24 of file Clock.hpp.

References start().

+ Here is the call graph for this function:

◆ ~Clock()

ven::Clock::~Clock ( )
default

◆ Clock() [2/3]

ven::Clock::Clock ( const Clock & )
delete

◆ Clock() [3/3]

ven::Clock::Clock ( Clock && )
delete

Member Function Documentation

◆ getDeltaTime()

float ven::Clock::getDeltaTime ( ) const
inlinenodiscard

Definition at line 38 of file Clock.hpp.

References m_deltaTime.

Referenced by ven::Engine::run().

+ Here is the caller graph for this function:

◆ getDeltaTimeMS()

float ven::Clock::getDeltaTimeMS ( ) const
inlinenodiscard

Definition at line 39 of file Clock.hpp.

References m_deltaTime.

Referenced by ven::Logger::logExecutionTime().

+ Here is the caller graph for this function:

◆ getFPS()

float ven::Clock::getFPS ( ) const
inlinenodiscard

Definition at line 40 of file Clock.hpp.

References m_deltaTime.

◆ now()

static std::chrono::high_resolution_clock::time_point ven::Clock::now ( )
inlinestatic

Definition at line 36 of file Clock.hpp.

◆ operator=() [1/2]

Clock & ven::Clock::operator= ( Clock && )
delete

◆ operator=() [2/2]

Clock & ven::Clock::operator= ( const Clock & )
delete

◆ resume()

void ven::Clock::resume ( )

Definition at line 20 of file clock.cpp.

◆ start()

void ven::Clock::start ( )
inline

Definition at line 32 of file Clock.hpp.

References m_startTime.

Referenced by Clock().

+ Here is the caller graph for this function:

◆ stop()

void ven::Clock::stop ( )

Definition at line 10 of file clock.cpp.

◆ update()

void ven::Clock::update ( )

Definition at line 3 of file clock.cpp.

References m_deltaTime, and m_startTime.

Referenced by ven::Logger::logExecutionTime(), and ven::Engine::run().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deltaTime

std::chrono::duration<float> ven::Clock::m_deltaTime {0.F}
private

Definition at line 46 of file Clock.hpp.

Referenced by getDeltaTime(), getDeltaTimeMS(), getFPS(), and update().

◆ m_isStopped

bool ven::Clock::m_isStopped {false}
private

Definition at line 48 of file Clock.hpp.

◆ m_startTime

TimePoint ven::Clock::m_startTime
private

Definition at line 44 of file Clock.hpp.

Referenced by start(), and update().

◆ m_stopTime

TimePoint ven::Clock::m_stopTime
private

Definition at line 45 of file Clock.hpp.


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