diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-03 19:44:47 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-03 19:44:47 +0100 |
commit | 668bd96c28c75a21c17c01d39553231be34be119 (patch) | |
tree | 64c85d1e2c69d43f468b57224c02427e5ea91552 /src/crepe/facade/SDLContext.h | |
parent | 9416841ad776d9117bc3b12ee3ceb9a8c7af4c73 (diff) | |
parent | cc821016c8ddce45a1e3f192415f58be237b8a1e (diff) |
Merge branch 'master' of github.com:lonkaars/crepe into jaro/collision-system
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r-- | src/crepe/facade/SDLContext.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/crepe/facade/SDLContext.h b/src/crepe/facade/SDLContext.h index 6030a6e..e49ca78 100644 --- a/src/crepe/facade/SDLContext.h +++ b/src/crepe/facade/SDLContext.h @@ -12,6 +12,8 @@ #include "../api/Camera.h" #include "../api/Sprite.h" +#include "api/Color.h" +#include "api/Texture.h" #include "types.h" namespace crepe { @@ -104,18 +106,11 @@ private: std::unique_ptr<SDL_Texture, std::function<void(SDL_Texture *)>> texture_from_path(const std::string & path); /** - * \brief Gets the width of a texture. + * \brief Gets the size of a texture. * \param texture Reference to the Texture object. - * \return Width of the texture as an integer. + * \return Width and height of the texture as an integer. */ - int get_width(const Texture & texture) const; - - /** - * \brief Gets the height of a texture. - * \param texture Reference to the Texture object. - * \return Height of the texture as an integer. - */ - int get_height(const Texture & texture) const; + ivec2 get_size(const Texture & ctx); private: //! Will use draw,clear_screen, present_screen, camera. @@ -160,6 +155,13 @@ private: */ SDL_Rect get_dst_rect(const Sprite & sprite, const vec2 & pos, const Camera & cam, const vec2 & cam_pos, const double & img_scale) const; + /** + * \brief Set an additional color value multiplied into render copy operations. + * + * \param texture the given texture to adjust + * \param color the color data for the texture + */ + void set_color_texture(const Texture & texture, const Color & color); private: //! sdl Window |