Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
tick.cpp File Reference
#include "tick.h"
#include <iostream>
#include <string>
#include <Strings/components/classes/events/game_engine_events/Tick/TickEvent.h>
#include <Strings/components/classes/events/events.h>
#include "components/diagnostics/crash/crash.h"
#include "components/diagnostics/logger/logger.h"
+ Include dependency graph for tick.cpp:

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...
 
uint64_t total_runtime_ticks = 0
 Number of game ticks that have been run during entire program execution. 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 ( )
+ Here is the caller graph for this function:

◆ doTick()

void doTick ( )

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

+ Here is the caller graph for this function:

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.

◆ total_runtime_ticks

uint64_t total_runtime_ticks = 0

Number of game ticks that have been run during entire program execution.