aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Texture.cpp')
-rw-r--r--src/crepe/api/Texture.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp
index 8fc5c13..5519e5e 100644
--- a/src/crepe/api/Texture.cpp
+++ b/src/crepe/api/Texture.cpp
@@ -30,3 +30,20 @@ void Texture::load(unique_ptr<Asset> res) {
SDLContext & ctx = SDLContext::get_instance();
this->texture = ctx.texture_from_path(res->canonical());
}
+
+int Texture::get_width() const{
+ if (this->texture) {
+ return SDLContext::get_instance().get_width(*this);
+ }
+ else {
+ return 0;
+ }
+}
+int Texture::get_height() const{
+ if (this->texture) {
+ return SDLContext::get_instance().get_height(*this);
+ }
+ else {
+ return 0;
+ }
+}