void ProgramCompiler::import(const string &name)
{
- if(!resources)
- throw runtime_error("no resources");
- RefPtr<IO::Seekable> io = resources->open_raw(name+".glsl");
+ string fn = name+".glsl";
+ RefPtr<IO::Seekable> io = (resources ? resources->open_raw(fn) : Resources::get_builtins().open(fn));
if(!io)
throw runtime_error(format("module %s not found", name));
ProgramParser import_parser;
VariableDeclaration *&ptr = variables[var.name];
if(ptr)
{
+ ptr->type = var.type;
if(var.init_expression)
ptr->init_expression = var.init_expression;
remove_node = true;