aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-08 20:21:36 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-08 20:21:36 +0100
commit506de66aaecc9b82415dde46058b848e46bc7258 (patch)
treea3f2427b0882d07f2d960b7214170533ad241830 /src/crepe/api/Texture.h
parent7817c85e84560933a33ad86ec3f9ca3d48d327d5 (diff)
nitpicks (merge #27)
Diffstat (limited to 'src/crepe/api/Texture.h')
-rw-r--r--src/crepe/api/Texture.h76
1 files changed, 39 insertions, 37 deletions
diff --git a/src/crepe/api/Texture.h b/src/crepe/api/Texture.h
index 9bda5fe..b89bc17 100644
--- a/src/crepe/api/Texture.h
+++ b/src/crepe/api/Texture.h
@@ -25,51 +25,53 @@ class Animator;
class Texture {
public:
- /**
- * \brief Constructs a Texture from a file path.
- * \param src Path to the image file to be loaded as a texture.
- */
- Texture(const char * src);
-
- /**
- * \brief Constructs a Texture from an Asset resource.
- * \param res Unique pointer to an Asset resource containing texture data.
- */
- Texture(std::unique_ptr<Asset> res);
-
- /**
- * \brief Destroys the Texture instance, freeing associated resources.
- */
- ~Texture();
-
- /**
- * \brief Gets the width of the texture.
- * \return Width of the texture in pixels.
- */
- int get_width() const;
-
- /**
- * \brief Gets the height of the texture.
- * \return Height of the texture in pixels.
- */
- int get_height() const;
+ /**
+ * \brief Constructs a Texture from a file path.
+ * \param src Path to the image file to be loaded as a texture.
+ */
+ Texture(const char * src);
+
+ /**
+ * \brief Constructs a Texture from an Asset resource.
+ * \param res Unique pointer to an Asset resource containing texture data.
+ */
+ Texture(std::unique_ptr<Asset> res);
+
+ /**
+ * \brief Destroys the Texture instance, freeing associated resources.
+ */
+ ~Texture();
+ // FIXME: this constructor shouldn't be necessary because this class doesn't
+ // manage memory
+
+ /**
+ * \brief Gets the width of the texture.
+ * \return Width of the texture in pixels.
+ */
+ int get_width() const;
+
+ /**
+ * \brief Gets the height of the texture.
+ * \return Height of the texture in pixels.
+ */
+ int get_height() 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<Asset> res);
+ /**
+ * \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<Asset> res);
private:
//! The texture of the class from the library
std::unique_ptr<SDL_Texture, std::function<void(SDL_Texture *)>> texture;
- //! Grants SDLContext access to private members.
- friend class SDLContext;
+ //! Grants SDLContext access to private members.
+ friend class SDLContext;
- //! Grants Animator access to private members.
- friend class Animator;
+ //! Grants Animator access to private members.
+ friend class Animator;
};
} // namespace crepe