diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-08-06 10:32:26 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-08-06 10:32:26 -0400 |
commit | 779fd068b6aadef909aefdd25d6ec4086300dde2 (patch) | |
tree | bdfe50ccc58fb2995968f8191935eec25bc072f2 /include/components/texture.hpp | |
parent | 189afb447e2c76e5dd5e4550e786c5175a828cbc (diff) |
easier initializaton
Diffstat (limited to 'include/components/texture.hpp')
-rw-r--r-- | include/components/texture.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/components/texture.hpp b/include/components/texture.hpp index 14253f1..ea08c77 100644 --- a/include/components/texture.hpp +++ b/include/components/texture.hpp @@ -4,11 +4,13 @@ #include "components/point.hpp" #include "window.hpp" +#include <string> + class Texture { public: - Texture(const char *path) { - tex = sdl2LoadTexture(path); + Texture(std::string path) { + tex = sdl2LoadTexture(path.c_str()); if (tex) SDL_QueryTexture(tex, nullptr, nullptr, &w, &h); } @@ -27,7 +29,7 @@ public: } Point dim() const noexcept { - return Point {static_cast<float>(w), static_cast<float>(h)}; + return Point(static_cast<float>(w), static_cast<float>(h)); } private: |