]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.cpp
Integrate ProgramCompiler with Program and Resources
[libs/gl.git] / source / program.cpp
index 82308b3405e0c42cc2086925c7633bd6b6a08770..2d298e82e9d29922a3c18b1d5236dadb25ae402b 100644 (file)
@@ -14,6 +14,7 @@
 #include "error.h"
 #include "misc.h"
 #include "program.h"
+#include "programcompiler.h"
 #include "shader.h"
 
 using namespace std;
@@ -35,6 +36,16 @@ Program::Program(const ProgramBuilder::StandardFeatures &features)
        link();
 }
 
+Program::Program(const std::string &source)
+{
+       init();
+
+       ProgramCompiler compiler;
+       compiler.compile(source);
+       compiler.add_shaders(*this);
+       link();
+}
+
 Program::Program(const string &vert, const string &frag)
 {
        init();