Override shaders by name.

This commit is contained in:
Unknown W. Brackets 2013-10-12 16:48:06 -07:00
parent 74db6d4e26
commit 775c37f387
2 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <string>
#include <vector>
#include <algorithm>
#include "base/logging.h"
#include "file/ini_file.h"
@ -80,6 +81,7 @@ void LoadPostShaderInfo(std::vector<std::string> directories) {
info.fragmentShaderFile = path + "/" + temp;
section.Get("Vertex", &temp, "");
info.vertexShaderFile = path + "/" + temp;
shaderInfo.erase(std::find(shaderInfo.begin(), shaderInfo.end(), info.name), shaderInfo.end());
shaderInfo.push_back(info);
}
}

View File

@ -34,6 +34,10 @@ struct ShaderInfo {
// TODO: Add support for all kinds of fun options like mapping the depth buffer,
// SRGB texture reads, multiple shaders chained, etc.
bool operator == (const std::string &other) {
return name == other;
}
};
const ShaderInfo *GetPostShaderInfo(std::string name);