#include "misc.h"
#include "program.h"
#include "programcompiler.h"
+#include "resources.h"
#include "shader.h"
using namespace std;
init();
ProgramCompiler compiler;
- compiler.compile(source);
+ if(source.find(';')==string::npos && source.size()>5 && !source.compare(source.size()-5, 5, ".glsl"))
+ {
+ if(RefPtr<IO::Seekable> io = Resources::get_builtins().open(source))
+ compiler.compile(*io);
+ else
+ throw IO::file_not_found(source);
+ }
+ else
+ compiler.compile(source);
compiler.add_shaders(*this);
link();
}