diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-08 11:44:21 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-08 11:44:21 +0100 |
commit | 9432900158e6a31815345fcf0af8d28ae34c6da9 (patch) | |
tree | 36f799da46ba8f5e921349d0f004b08d6d2f29ea /src/crepe/api/Texture.cpp | |
parent | 1c4156ee127b14760ed3b1a0cd16ad12180c7ac6 (diff) |
code style
Diffstat (limited to 'src/crepe/api/Texture.cpp')
-rw-r--r-- | src/crepe/api/Texture.cpp | 17 |
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; + } +} |