GLES2/SHADERS: add search path for loading shaders from source code directory
This commit is contained in:
parent
4888f4368c
commit
b08462d1bc
1 changed files with 8 additions and 0 deletions
|
@ -30,9 +30,17 @@ namespace Graphics {
|
|||
|
||||
static const GLchar *readFile(const Common::String &filename) {
|
||||
Common::File file;
|
||||
|
||||
// Allow load shaders without install them from source code directory.
|
||||
// It's used for development purpose
|
||||
// FIXME: it's doesn't work with just search subdirs in 'engines'
|
||||
SearchMan.addDirectory("GRIM_SHADERS", "engines/grim", 0, 2);
|
||||
SearchMan.addDirectory("MYST3_SHADERS", "engines/myst3", 0, 2);
|
||||
file.open(Common::String("shaders/") + filename);
|
||||
if (!file.isOpen())
|
||||
error("Could not open shader %s!", filename.c_str());
|
||||
SearchMan.remove("GRIM_SHADERS");
|
||||
SearchMan.remove("MYST3_SHADERS");
|
||||
|
||||
const int32 size = file.size();
|
||||
GLchar *shaderSource = new GLchar[size + 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue