summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Clock.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-05 23:18:53 +0200
committerAki <please@ignore.pl>2022-04-05 23:18:53 +0200
commit3b004ab63c16f2eb783e29a35131450ba28383a3 (patch)
tree95333d21cbbf06245404ff1fc1ad6ea2f8a8e10a /StarsEx/Clock.h
parentb61b59ae1b7cd4041ef0a815b7e96537418298c9 (diff)
downloadstarshatter-3b004ab63c16f2eb783e29a35131450ba28383a3.zip
starshatter-3b004ab63c16f2eb783e29a35131450ba28383a3.tar.gz
starshatter-3b004ab63c16f2eb783e29a35131450ba28383a3.tar.bz2
Elapsed time clock methods are now templates
Diffstat (limited to 'StarsEx/Clock.h')
-rw-r--r--StarsEx/Clock.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/StarsEx/Clock.h b/StarsEx/Clock.h
index 4f51330..39e08ac 100644
--- a/StarsEx/Clock.h
+++ b/StarsEx/Clock.h
@@ -8,14 +8,13 @@
#define Clock_h
#include <chrono>
+#include <cstdint>
class Clock
{
public:
using inner_clock = std::chrono::high_resolution_clock;
- using elapsed_duration = std::chrono::milliseconds;
- using count_type = elapsed_duration::rep;
static Clock* GetInstance();
static bool Init();
@@ -30,8 +29,8 @@ public:
double GuiDelta() const;
double Rate() const;
double TimeCompression() const;
- count_type GameTime() const;
- count_type RealTime() const;
+ template <typename R = std::uint32_t> R GameTime() const;
+ template <typename R = std::uint32_t> R RealTime() const;
void SetTimeCompression(double compression);
@@ -51,4 +50,6 @@ private:
};
+#include "Clock.inl"
+
#endif // Clock_h