From 9432900158e6a31815345fcf0af8d28ae34c6da9 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Fri, 8 Nov 2024 11:44:21 +0100 Subject: code style --- src/crepe/api/Texture.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/crepe/api/Texture.cpp') 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 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; + } +} -- cgit v1.2.3