Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Engine::Resource::Time Struct Reference

Resource that stores the elapsed time since the last frame. More...

#include <Time.hpp>

Static Public Member Functions

static void Update (Core &core)
 Update the _elapsedTime since the last frame. It should be called at the beginning of each frame to update the elapsed time. This is a system.

Public Attributes

float _elapsedTime = 0.0f
 Elapsed time since the last frame in seconds.
std::chrono::time_point< std::chrono::high_resolution_clock > _lastTime = std::chrono::high_resolution_clock::now()
 The time point of the last frame. It is used to calculate the elapsed time since the last frame.

Detailed Description

Resource that stores the elapsed time since the last frame.

Member Function Documentation

◆ Update()

void Engine::Resource::Time::Update ( Core & core)
inlinestatic

Update the _elapsedTime since the last frame. It should be called at the beginning of each frame to update the elapsed time. This is a system.

Parameters
coreReference to the core.
See also
Engine::Resource::Time::_elapsedTime
Todo
put the implementation in the cpp file

Member Data Documentation

◆ _elapsedTime

float Engine::Resource::Time::_elapsedTime = 0.0f

Elapsed time since the last frame in seconds.

◆ _lastTime

std::chrono::time_point<std::chrono::high_resolution_clock> Engine::Resource::Time::_lastTime = std::chrono::high_resolution_clock::now()

The time point of the last frame. It is used to calculate the elapsed time since the last frame.


The documentation for this struct was generated from the following file: