diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-09-30 10:56:13 +0200 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-09-30 10:56:13 +0200 |
commit | a08f5acf483d5371ccab70ba75c39ac6a5f96ce7 (patch) | |
tree | 433be57896814c82625066ff901b1c7bc951c951 /resource-manager/Image_asset.cpp | |
parent | a6f3b8c71513a1a7d416ec57627836ed4d9a7d94 (diff) |
changed resource manager based on feedback
Diffstat (limited to 'resource-manager/Image_asset.cpp')
-rw-r--r-- | resource-manager/Image_asset.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/resource-manager/Image_asset.cpp b/resource-manager/Image_asset.cpp index c5599e9..0b3afad 100644 --- a/resource-manager/Image_asset.cpp +++ b/resource-manager/Image_asset.cpp @@ -3,31 +3,14 @@ #include "Image_asset.h" #include <SDL_image.h> #include <SDL_surface.h> +#include <string> -Texture::Texture(const std::string& path){ - m_surface = IMG_Load(path.c_str()); +Texture::Texture(const std::string& content){ + this->m_content = content; } -void Texture::setTexture(SDL_Renderer& renderer){ - m_texture = SDL_CreateTextureFromSurface(&renderer, m_surface); -} Texture::~Texture(){ - if (m_surface) { - SDL_FreeSurface(m_surface); - } - - if(m_texture){ - SDL_DestroyTexture(m_texture); - } -} - -SDL_Surface* Texture::getSurface() const { - return m_surface; -} - -SDL_Texture* Texture::getTexture() const{ - return m_texture; } |