X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramcompiler.cpp;h=13c73e4ac0a79694d4d50c7e37b14b6ffd69b1bb;hb=e55f79ccb21e8c1be3d86f127e3ec1583e58ce92;hp=d65869316423d64806a23bdf3e60254d0f014ce7;hpb=b2764a3a349b48d7445202faa903383386c09a4c;p=libs%2Fgl.git diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index d6586931..13c73e4a 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -123,9 +123,8 @@ void ProgramCompiler::process() void ProgramCompiler::import(const string &name) { - if(!resources) - throw runtime_error("no resources"); - RefPtr io = resources->open_raw(name+".glsl"); + string fn = name+".glsl"; + RefPtr 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;