redhand::game_loop_event class

A game loop event is raised once every game loop tick.

This event is independed drawing events and should be used to define game logic and physics.

Base classes

template<class T>
class event<engine>
A general class for raising events, specific events types should be a subclass of this general event.

Constructors, destructors, conversion operators

game_loop_event(engine* raiser, std::chrono::nanoseconds delta_t)
raise a new game loop event that is raised once every game loop tick.

Public functions

auto getFrameTime() -> std::chrono::nanoseconds
Get the time difference between the last game loop tick and this one.

Function documentation

redhand::game_loop_event::game_loop_event(engine* raiser, std::chrono::nanoseconds delta_t)

raise a new game loop event that is raised once every game loop tick.

Parameters
raiser a pointer to the object that raised the event
delta_t the time difference to the last game_loop_event

This event is independed drawing events and should be used to define game logic and physics.

std::chrono::nanoseconds redhand::game_loop_event::getFrameTime()

Get the time difference between the last game loop tick and this one.

Returns std::chrono::nanoseconds the time difference between the last event and the current one.