'Assets', some refactor

This commit is contained in:
MihailRis
2022-03-03 18:14:34 +03:00
committed by GitHub
parent b7e8ff5bea
commit 2aba3e91db
19 changed files with 350 additions and 213 deletions
+31
View File
@@ -0,0 +1,31 @@
#include "Assets.h"
#include "graphics/Texture.h"
#include "graphics/Shader.h"
Assets::~Assets() {
for (auto& iter : shaders){
delete iter.second;
}
for (auto& iter : textures){
delete iter.second;
}
}
Texture* Assets::getTexture(std::string name){
return textures[name];
}
void Assets::store(Texture* texture, std::string name){
textures[name] = texture;
}
Shader* Assets::getShader(std::string name){
return shaders[name];
}
void Assets::store(Shader* shader, std::string name){
shaders[name] = shader;
}