]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.cpp
Refactor the interface of SL::Compiler
[libs/gl.git] / source / core / program.cpp
index 00bca8343cb4d89e05f619f78bda72773a76ce77..4cdbf97c0fcdf84431b1ba88044cc8bd41addb07 100644 (file)
@@ -14,9 +14,9 @@
 #include "error.h"
 #include "misc.h"
 #include "program.h"
-#include "programcompiler.h"
 #include "resources.h"
 #include "shader.h"
+#include "glsl/compiler.h"
 
 using namespace std;
 
@@ -32,16 +32,17 @@ Program::Program(const std::string &source)
 {
        init();
 
-       ProgramCompiler compiler;
+       SL::Compiler compiler;
        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, source);
+                       compiler.load_source(*io, source);
                else
                        throw IO::file_not_found(source);
        }
        else
-               compiler.compile(source);
+               compiler.set_source(source);
+       compiler.compile();
        compiler.add_shaders(*this);
        link();
 }