vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
clock.cpp
Go to the documentation of this file.
2
4{
5 auto newTime = std::chrono::high_resolution_clock::now();
6 m_deltaTime = newTime - m_startTime;
7 m_startTime = newTime;
8}
9
11{
12 if (m_isStopped) {
13 return;
14 }
15
16 m_stopTime = std::chrono::high_resolution_clock::now();
17 m_isStopped = true;
18}
19
21{
22 if (!m_isStopped) {
23 return;
24 }
25
26 m_startTime += std::chrono::high_resolution_clock::now() - m_stopTime;
27 m_isStopped = false;
28}
This file contains the Clock class.
std::chrono::duration< float > m_deltaTime
Definition Clock.hpp:46
TimePoint m_startTime
Definition Clock.hpp:44
void update()
Definition clock.cpp:3
void stop()
Definition clock.cpp:10
void resume()
Definition clock.cpp:20