aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/SDLContext.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-04 10:27:42 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-04 10:27:42 +0100
commit7d1f3b90a5d640e4ae23d6ff8f0bf1bf35b6e4cb (patch)
tree0697c269ce96e55c7841344ec426e0e3daa2c864 /src/crepe/facade/SDLContext.h
parent5981ab2262a98b80a1339f86a6b71093576a9b35 (diff)
parentc7c4cc0e3b1a3152256bc8ebf6494c19519538db (diff)
merge 2 gameloop branches
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