X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fcompiler.h;h=8e83990613343c0fdc8510053ffaac1617d4d283;hb=73bef37da97b6da0b99227f63235cb52c4e56c44;hp=c8cb565fa1270c12d94c290a8479b0adef6f2084;hpb=696a97bd7411d69953c1a9e4b5f3dfb4c1d848f1;p=libs%2Fgl.git diff --git a/source/glsl/compiler.h b/source/glsl/compiler.h index c8cb565f..8e839906 100644 --- a/source/glsl/compiler.h +++ b/source/glsl/compiler.h @@ -4,7 +4,6 @@ #include #include "parser.h" #include "program.h" -#include "resources.h" #include "syntax.h" namespace Msp { @@ -14,7 +13,6 @@ namespace SL { class Compiler { private: - Resources *resources; Module *module; std::vector imported_names; @@ -22,24 +20,23 @@ public: Compiler(); ~Compiler(); - void compile(const std::string &, const std::string & = ""); - void compile(IO::Base &, Resources * = 0, const std::string & = ""); - void compile(IO::Base &, const std::string &); +private: + void clear(); +public: + void set_source(const std::string &, const std::string & = ""); + void load_source(IO::Base &, DataFile::Collection * = 0, const std::string & = ""); + void load_source(IO::Base &, const std::string &); + void compile(); void add_shaders(Program &); private: - void append_module(Module &); + void append_module(Module &, DataFile::Collection *); void append_stage(Stage &); - void process(); - void import(const std::string &); + void import(DataFile::Collection *, const std::string &); void generate(Stage &); bool optimize(Stage &); void finalize(Stage &); static void inject_block(Block &, const Block &); - template - static typename T::ResultType apply(Stage &); - template - static typename T::ResultType apply(Stage &, const A &); }; } // namespace SL