X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogrambuilder.h;h=7840ecf00a2ef993a3590b6dd802f798b3d5878e;hp=14a90a85250eeb50c038e1498382210e3acd3bef;hb=103cebacd5572e770e4463163688802ee4f6efbf;hpb=126ac7ca4053b765eab1473d2865bce728ef2428 diff --git a/source/programbuilder.h b/source/programbuilder.h index 14a90a85..7840ecf0 100644 --- a/source/programbuilder.h +++ b/source/programbuilder.h @@ -11,6 +11,13 @@ namespace GL { class Program; +class invalid_variable_definition: public std::invalid_argument +{ +public: + invalid_variable_definition(const std::string &w): std::invalid_argument(w) { } + virtual ~invalid_variable_definition() throw() { } +}; + class ProgramBuilder { public: @@ -29,9 +36,8 @@ public: bool normalmap; bool shadow; bool reflection; - bool transform; - bool colorify; bool legacy; + std::string custom; StandardFeatures(); @@ -48,7 +54,7 @@ private: FRAGMENT }; - struct StandardVariable + struct VariableDefinition { VariableScope scope; const char *name; @@ -60,7 +66,7 @@ private: struct ShaderVariable { std::string name; - const StandardVariable *variable; + const VariableDefinition *variable; std::string resolved_name; bool fuzzy_space; std::string resolved_space; @@ -71,7 +77,7 @@ private: ShaderVariable(const std::string &); - void resolve(const StandardVariable &); + void resolve(const VariableDefinition &); void resolve(ShaderVariable &); void resolve_space(const std::string &); void add_reference(ShaderVariable &); @@ -89,10 +95,11 @@ private: }; StandardFeatures features; + std::list custom_variables; std::string feature_flags; bool optimize; - static const StandardVariable standard_variables[]; + static const VariableDefinition standard_variables[]; public: ProgramBuilder(const StandardFeatures &);