aboutsummaryrefslogtreecommitdiff
path: root/resource-manager/Image_asset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'resource-manager/Image_asset.cpp')
-rw-r--r--resource-manager/Image_asset.cpp23
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;
}