Skip to content
Snippets Groups Projects
Commit 05c88c98 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Shaders should be distinct for now

parent 3b20d81c
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,9 @@ std::shared_ptr<Heightmap> ResourceManager::fetch_heightmap(const std::string fi
}
else {
try {
std::cout << "Constructing Heightmap " << filename << std::endl << std::flush;
_heightmaps.push_back(std::make_shared<Heightmap>(filename));
std::cout << "Heightmap constructed." << std::endl << std::flush;
return _heightmaps.back();
}
catch(std::exception e){
......@@ -26,8 +28,12 @@ std::shared_ptr<Heightmap> ResourceManager::fetch_heightmap(const std::string fi
}
std::shared_ptr<Shader> ResourceManager::fetch_shader(const std::string vertexPath, const std::string fragmentPath) {
/*Check if Heightmap is already loaded*/
/*Check if Shader is already loaded*/
/*TODO: For the moment, this is disabled, because not all uniforms are applied per drawcall, there is some heightmap-state stored in them.*/
/*
auto found = std::find_if(_shaders.begin(), _shaders.end(), [vertexPath, fragmentPath](auto s) {return s->is(vertexPath, fragmentPath); });
*/
auto found = _shaders.end();
if (found != _shaders.end()) {
return *found;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment