16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 20:39:18 +02:00

maintenance: memory leak fix, default constructors, minor syntax cleanups

This commit is contained in:
tmj-fstate
2018-06-16 15:59:28 +02:00
parent ef5811e6c0
commit 14448d70d1
18 changed files with 74 additions and 61 deletions

View File

@@ -29,6 +29,9 @@ void UpdateTimers(bool pause);
class stopwatch {
public:
// constructors
stopwatch() = default;
// methods
void
start() {
m_start = std::chrono::steady_clock::now(); }
@@ -40,6 +43,7 @@ public:
return m_accumulator / 20.f;}
private:
// members
std::chrono::time_point<std::chrono::steady_clock> m_start { std::chrono::steady_clock::now() };
float m_accumulator { 1000.f / 30.f * 20.f }; // 20 last samples, initial 'neutral' rate of 30 fps
};