Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Time.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "core/Core.hpp"
4#include <chrono>
5
6namespace Engine::Resource {
9struct Time {
11 float _elapsedTime = 0.0f;
12
14 std::chrono::time_point<std::chrono::high_resolution_clock> _lastTime = std::chrono::high_resolution_clock::now();
15
20 static void Update(Core &core);
21};
22} // namespace Engine::Resource
The core is the place where all the data of the engine is stored. It contains the registry (entities)...
Definition Core.hpp:33
Definition Time.cpp:3
Resource that stores the elapsed time since the last frame.
Definition Time.hpp:9
float _elapsedTime
Elapsed time since the last frame in seconds.
Definition Time.hpp:11
static void Update(Core &core)
Update the _elapsedTime since the last frame. It should be called at the beginning of each frame to u...
Definition Time.cpp:4
std::chrono::time_point< std::chrono::high_resolution_clock > _lastTime
The time point of the last frame. It is used to calculate the elapsed time since the last frame.
Definition Time.hpp:14