diff options
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: |