]> 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 d52dbe34fb61c745e74c4cad108cdd0a604990e7..dc034746652c0559a60972b8613e4d93956bb054 100644 (file)
@@ -12,7 +12,6 @@
 #include "pipelinetemplate.h"
 #include "pose.h"
 #include "program.h"
-#include "programcompiler.h"
 #include "resourcemanager.h"
 #include "resources.h"
 #include "sampler.h"
@@ -21,6 +20,7 @@
 #include "texture2d.h"
 #include "texture2darray.h"
 #include "texturecube.h"
+#include "glsl/compiler.h"
 
 using namespace std;
 
@@ -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;
        }
@@ -172,8 +174,9 @@ Program *Resources::create_program(const string &name)
 
        if(RefPtr<IO::Seekable> io = open_raw(name))
        {
-               ProgramCompiler compiler;
-               compiler.compile(*io, this, name);
+               SL::Compiler compiler;
+               compiler.load_source(*io, this, name);
+               compiler.compile();
                RefPtr<Program> program = new Program;
                compiler.add_shaders(*program);
                program->link();