diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:54:56 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-11 18:54:56 +0100 |
commit | 904b853a277c3fcd0f84561b6e45bcbd4f0b25c6 (patch) | |
tree | 84b8b3d3c29471e4edc2707444b21ac406ee2799 /src/crepe/api/LoopTimer.cpp | |
parent | 876746db205b259430b6b438227c986dbf0cb59d (diff) | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) |
merge master
Diffstat (limited to 'src/crepe/api/LoopTimer.cpp')
-rw-r--r-- | src/crepe/api/LoopTimer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/crepe/api/LoopTimer.cpp b/src/crepe/api/LoopTimer.cpp index 15a0e3a..56e48d3 100644 --- a/src/crepe/api/LoopTimer.cpp +++ b/src/crepe/api/LoopTimer.cpp @@ -1,17 +1,16 @@ #include <chrono> -#include "../facade/SDLContext.h" #include "../util/Log.h" +#include "facade/SDLContext.h" +#include "manager/Manager.h" #include "LoopTimer.h" using namespace crepe; -LoopTimer::LoopTimer() { dbg_trace(); } - -LoopTimer & LoopTimer::get_instance() { - static LoopTimer instance; - return instance; +LoopTimer::LoopTimer(Mediator & mediator) : Manager(mediator) { + dbg_trace(); + mediator.timer = *this; } void LoopTimer::start() { @@ -67,7 +66,8 @@ void LoopTimer::enforce_frame_rate() { = std::chrono::duration_cast<std::chrono::milliseconds>(this->frame_target_time - frame_duration); if (delay_time.count() > 0) { - SDLContext::get_instance().delay(delay_time.count()); + SDLContext & ctx = this->mediator.sdl_context; + ctx.delay(delay_time.count()); } } |