diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 17:02:18 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 17:02:18 +0100 |
commit | 715be63e514066fec1962f47f85d0754cbf37755 (patch) | |
tree | 5c3bf3728cce9413be36f20021ffbe511bbba20f /src/crepe/api/LoopTimer.cpp | |
parent | 9b337ae01e4f3efc6ad3be5af33e3df8e9224d71 (diff) | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) |
Merge branch 'master' into niels/UI
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()); } } |