]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resources/resources.cpp
Load various built-in things through Resources
[libs/gl.git] / source / resources / resources.cpp
index 11099ae077d935b8daf66318d37cf64e5eb768f4..dc034746652c0559a60972b8613e4d93956bb054 100644 (file)
@@ -28,6 +28,7 @@ namespace Msp {
 namespace GL {
 
 void init_shaderlib(DataFile::BuiltinSource &);
+void init_builtin_data(DataFile::BuiltinSource &);
 
 Resources::Resources():
        default_tex_filter(Texture::can_generate_mipmap() ? LINEAR_MIPMAP_LINEAR : LINEAR),
@@ -65,6 +66,7 @@ const DataFile::CollectionSource &Resources::get_builtins()
 
        if(!init_done)
        {
+               init_builtin_data(builtins);
                init_shaderlib(builtins);
                init_done = true;
        }
@@ -173,7 +175,8 @@ Program *Resources::create_program(const string &name)
        if(RefPtr<IO::Seekable> io = open_raw(name))
        {
                SL::Compiler compiler;
-               compiler.compile(*io, this, name);
+               compiler.load_source(*io, this, name);
+               compiler.compile();
                RefPtr<Program> program = new Program;
                compiler.add_shaders(*program);
                program->link();