Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
tick.cpp File Reference

Functions

float checkElapsedTime ()
 
void doTick ()
 Fires a #Blam::Events::TickEvent event to inform all listeners to update based on the game tick. More...
 

Variables

int max_tickrate = 60
 Maximum number of times doTick() should be run per second. More...
 
int ticks_this_second = 0
 Number of game ticks that have been run this second. More...
 
LARGE_INTEGER last_second_time
 Timestamp of previous second/tick counter reset. More...
 
LARGE_INTEGER clock_frequency
 The frequency of the CPU clock. Used in calculations for tick rate. More...
 
float seconds_per_tick = 1.0f / float(max_tickrate)
 The number of seconds within a single tick. Usually much less than 1 second. More...
 
float total_elapsed_time = 0.0f
 The total amount of time elapsed this second. Used to determine how many ticks have run this second. More...
 
bool run_tick_loop = true
 Whether or not to continue running the game tick loop. More...
 
bool pause_tick = false
 Whether or not to temporarily pause the game tick. More...
 
bool has_tick_stopped = false
 Whether or not the game tick loop has terminated. More...
 

Function Documentation

◆ checkElapsedTime()

float checkElapsedTime ( )

◆ doTick()

void doTick ( )

Fires a #Blam::Events::TickEvent event to inform all listeners to update based on the game tick.

Variable Documentation

◆ clock_frequency

LARGE_INTEGER clock_frequency

The frequency of the CPU clock. Used in calculations for tick rate.

◆ has_tick_stopped

bool has_tick_stopped = false

Whether or not the game tick loop has terminated.

◆ last_second_time

LARGE_INTEGER last_second_time

Timestamp of previous second/tick counter reset.

◆ max_tickrate

int max_tickrate = 60

Maximum number of times doTick() should be run per second.

◆ pause_tick

bool pause_tick = false

Whether or not to temporarily pause the game tick.

◆ run_tick_loop

bool run_tick_loop = true

Whether or not to continue running the game tick loop.

◆ seconds_per_tick

float seconds_per_tick = 1.0f / float(max_tickrate)

The number of seconds within a single tick. Usually much less than 1 second.

◆ ticks_this_second

int ticks_this_second = 0

Number of game ticks that have been run this second.

◆ total_elapsed_time

float total_elapsed_time = 0.0f

The total amount of time elapsed this second. Used to determine how many ticks have run this second.