diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-12 19:59:21 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-12 19:59:21 +0100 |
commit | 8850ba096b6b4ae2dc3a813620dd35433b3c6c55 (patch) | |
tree | 6d2dc47bfc543225963ec4bbceefc55ea71fed65 /src/crepe/facade | |
parent | 8524865e9a62974f77f63d70929000fc63c679d7 (diff) | |
parent | f2509e89c02894ebd3ad992324eb300103621d26 (diff) |
Merge branch 'master' into niels/RenderingParticle
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 cc2e2f8..378ccee 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -191,3 +191,4 @@ int SDLContext::get_height(const Texture & ctx) { 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 7329b74..c4392bd 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -59,12 +59,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: /** |