aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-08 19:49:41 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-08 19:49:41 +0100
commit519cc5d16e65ff501d330c03eeb35d2d095ead29 (patch)
tree3c7c3a64c922ec248f4136d1282530a6ec6647ac /src/crepe/api/Texture.h
parent63bcd54e0e0ea64cfef5950568b4253d5dae5c1e (diff)
made sdlcontext not a singleton anymore
Diffstat (limited to 'src/crepe/api/Texture.h')
-rw-r--r--src/crepe/api/Texture.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/crepe/api/Texture.h b/src/crepe/api/Texture.h
index f9c7919..4eb1058 100644
--- a/src/crepe/api/Texture.h
+++ b/src/crepe/api/Texture.h
@@ -15,6 +15,7 @@ namespace crepe {
class SDLContext;
class Animator;
+class Mediator;
/**
* \class Texture
@@ -30,31 +31,19 @@ public:
* \brief Constructs a Texture from an Asset resource.
* \param src Asset with texture data to load.
*/
- Texture(const Asset & src);
+ Texture(const Asset & src, Mediator & mediator);
/**
* \brief Destroys the Texture instance, freeing associated resources.
*/
~Texture();
- /**
- * \brief Gets the width and height of the texture.
- * \return Width and height of the texture in pixels.
- */
- ivec2 get_size() const;
-
-private:
- /**
- * \brief Loads the texture from an Asset resource.
- * \param res Unique pointer to an Asset resource to load the texture from.
- */
- void load(std::unique_ptr<SDL_Texture, std::function<void(SDL_Texture *)>> texture);
-
private:
//! The texture of the class from the library
std::unique_ptr<SDL_Texture, std::function<void(SDL_Texture *)>> texture;
- bool loaded = false;
+ // texture size in pixel
+ ivec2 size;
//! Grants SDLContext access to private members.
friend class SDLContext;