Index

zydeco / fractal

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
703 Sep 2023 16:015f524c5OpenGL render abstractionsJosh Stockin1380G

Blob @ zydeco / include / sdl2 / TimerSDL2.hpp

text/plain731 bytesdownload raw
1#ifndef TIMER_SDL2_HPP_
2#define TIMER_SDL2_HPP_
3
4
5#include "IUpdateable.hpp"
6#include "ITimer.hpp"
7
8
9class TimerSDL2 : public ITimer
10{
11public:
12 // TimerSDL2
13 TimerSDL2();
14 ~TimerSDL2() = default;
15
16 // IUpdateable
17 bool Update() override;
18
19 // ITimer
20 void Reset() override;
21 void SetTimeout(uint64_t timeout_ms) override;
22 void Start() override;
23 void Stop() override;
24 bool IsExpired() override;
25 uint64_t *GetGlobalTimePointer() override;
26
27private:
28 static uint64_t s_globalCounterMs;
29 static bool s_globalCounterInitialized;
30
31 uint64_t m_instanceStartTimeMs;
32 uint64_t m_instanceTimeoutMs;
33 bool m_instanceRunning;
34 bool m_instanceExpired;
35};
36
37
38#endif /* TIMER_SDL2_HPP_ */
39