GameKit  0.0.1a
C++ gamedev tools
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
gk::GameClock Class Reference

#include <GameClock.hpp>

Public Member Functions

void measureLastFrameDuration ()
 
void updateGame (std::function< void(void)> updateFunc)
 
void drawGame (std::function< void(void)> drawFunc)
 
void waitForNextFrame ()
 
void setTimestep (u8 timestep)
 

Static Public Member Functions

static u32 getTicks (bool realTime=false)
 

Private Attributes

u32 m_lastFrameDate = 0
 
u32 m_lag = 0
 
u32 m_timeDropped = 0
 
u8 m_timestep = 6
 
u8 m_numUpdates = 0
 

Static Private Attributes

static u32 ticks = 0
 

Detailed Description

Definition at line 23 of file GameClock.hpp.

Member Function Documentation

§ drawGame()

void gk::GameClock::drawGame ( std::function< void(void)>  drawFunc)

Definition at line 56 of file GameClock.cpp.

§ getTicks()

u32 gk::GameClock::getTicks ( bool  realTime = false)
static

Definition at line 21 of file GameClock.cpp.

§ measureLastFrameDuration()

void gk::GameClock::measureLastFrameDuration ( )

Definition at line 29 of file GameClock.cpp.

§ setTimestep()

void gk::GameClock::setTimestep ( u8  timestep)
inline

Definition at line 35 of file GameClock.hpp.

§ updateGame()

void gk::GameClock::updateGame ( std::function< void(void)>  updateFunc)

Definition at line 43 of file GameClock.cpp.

§ waitForNextFrame()

void gk::GameClock::waitForNextFrame ( )

Definition at line 64 of file GameClock.cpp.

Member Data Documentation

§ m_lag

u32 gk::GameClock::m_lag = 0
private

Definition at line 41 of file GameClock.hpp.

§ m_lastFrameDate

u32 gk::GameClock::m_lastFrameDate = 0
private

Definition at line 40 of file GameClock.hpp.

§ m_numUpdates

u8 gk::GameClock::m_numUpdates = 0
private

Definition at line 45 of file GameClock.hpp.

§ m_timeDropped

u32 gk::GameClock::m_timeDropped = 0
private

Definition at line 42 of file GameClock.hpp.

§ m_timestep

u8 gk::GameClock::m_timestep = 6
private

Definition at line 44 of file GameClock.hpp.

§ ticks

u32 gk::GameClock::ticks = 0
staticprivate

Definition at line 38 of file GameClock.hpp.


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