diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-12 18:28:12 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-12 18:28:12 +0100 |
commit | daf2a06ac778f203e1473431afe09476e8182f65 (patch) | |
tree | d057891d87c946b7f3b28c4c8fc6a27b730c0d7d /src/crepe/facade | |
parent | 0e9a4b0e9b4ba92290c106cda7164607c499940c (diff) | |
parent | d9130d78738b6cb1bdc4e7ec65362b0ef46b1035 (diff) |
Merge branch 'master' into loek/cleanup
Diffstat (limited to 'src/crepe/facade')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 1 | ||||
-rw-r--r-- | src/crepe/facade/SDLContext.h | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index c4c96e2..39d0d4d 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -191,3 +191,4 @@ int SDLContext::get_height(const Texture & ctx) const { SDL_QueryTexture(ctx.texture.get(), NULL, NULL, NULL, &h); return h; } +void SDLContext::delay(int ms) const { SDL_Delay(ms); } diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index e358c21..536dec5 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -58,12 +58,23 @@ private: private: //! Will only use get_ticks friend class AnimatorSystem; - + //! Will only use delay + friend class LoopTimer; /** * \brief Gets the current SDL ticks since the program started. * \return Current ticks in milliseconds as a constant uint64_t. */ uint64_t get_ticks() const; + /** + * \brief Pauses the execution for a specified duration. + * + * This function uses SDL's delay function to halt the program execution + * for a given number of milliseconds, allowing for frame rate control + * or other timing-related functionality. + * + * \param ms Duration of the delay in milliseconds. + */ + void delay(int ms) const; private: /** |