aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-04 14:02:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-04 14:02:27 +0100
commit17e296d059f09d47009f2427132af8f5f8e2f749 (patch)
tree8164cfa54670b76de42542ba9bbde6fc6d17ab17 /src/crepe/facade/SDLContext.h
parent7a8657dfe019104aced61a5b63e63f61ad919f7a (diff)
parent210800c5fa71460d9cbcfff808a62cc07e0fdb7a (diff)
Merge branch 'master' into loek/audio
Diffstat (limited to 'src/crepe/facade/SDLContext.h')
-rw-r--r--src/crepe/facade/SDLContext.h22
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