diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-08 12:16:41 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-08 12:16:41 +0100 |
commit | 2e0b75fc51c4ef025f6b74f7f1648d04039bb955 (patch) | |
tree | 8f77d29c65b5b4e99b17accc5aea48c1115e10e4 /src/crepe/facade/SDLContext.cpp | |
parent | 9f029bf458d43492093507f9b59a67f4f22c283c (diff) |
fixed the includes and const settings
Diffstat (limited to 'src/crepe/facade/SDLContext.cpp')
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index bbeb3a9..9a2d15a 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -98,11 +98,11 @@ void SDLContext::handle_events(bool & running) { */ } -void SDLContext::clear_screen() { SDL_RenderClear(this->game_renderer); } -void SDLContext::present_screen() { SDL_RenderPresent(this->game_renderer); } +void SDLContext::clear_screen() const { SDL_RenderClear(this->game_renderer); } +void SDLContext::present_screen() const { SDL_RenderPresent(this->game_renderer); } void SDLContext::draw(const Sprite & sprite, const Transform & transform, - const Camera & cam) { + const Camera & cam) const { static SDL_RendererFlip render_flip = (SDL_RendererFlip) ((SDL_FLIP_HORIZONTAL * sprite.flip.flip_x) @@ -147,7 +147,7 @@ void SDLContext::camera(const Camera & cam) { const uint64_t SDLContext::get_ticks() const { return SDL_GetTicks64(); } -SDL_Texture * SDLContext::texture_from_path(const char * path) { +SDL_Texture * SDLContext::texture_from_path(const char * path) const { dbg_trace(); SDL_Surface * tmp = IMG_Load(path); @@ -165,12 +165,12 @@ SDL_Texture * SDLContext::texture_from_path(const char * path) { return created_texture; } -int SDLContext::get_width(const Texture & ctx) { +int SDLContext::get_width(const Texture & ctx) const { int w; SDL_QueryTexture(ctx.texture, NULL, NULL, &w, NULL); return w; } -int SDLContext::get_height(const Texture & ctx) { +int SDLContext::get_height(const Texture & ctx) const { int h; SDL_QueryTexture(ctx.texture, NULL, NULL, NULL, &h); return h; |