X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogrambuilder.h;h=9ca9c8539b54c1046a2d97b29e7b854506c128d2;hb=2e9d7c9f5741d17f77ce27273590ee16b791fb64;hp=678ee2ca142d9b31e264d2abad9d33ef9fbb31d2;hpb=a1eb8711ba225bb4423868c50369ad5592465171;p=libs%2Fgl.git diff --git a/source/programbuilder.h b/source/programbuilder.h index 678ee2ca..9ca9c853 100644 --- a/source/programbuilder.h +++ b/source/programbuilder.h @@ -39,6 +39,7 @@ public: bool material; bool lighting; unsigned max_lights; + bool skylight; bool specular; bool normalmap; bool shadow; @@ -55,6 +56,7 @@ private: enum VariableScope { NO_SCOPE, + TYPE, UNIFORM, ATTRIBUTE, VERTEX, @@ -83,7 +85,9 @@ private: { std::string name; const VariableDefinition *variable; + const VariableDefinition *type; std::string resolved_name; + std::string resolved_block; bool fuzzy_space; std::string resolved_space; bool array_sum; @@ -99,6 +103,7 @@ private: void resolve(const VariableDefinition &); void resolve(ShaderVariable &); + void resolve_type(const VariableDefinition &); void resolve_space(const std::string &); void resolve_array(const StandardFeatures &, unsigned = 0); void add_reference(ShaderVariable &); @@ -106,6 +111,7 @@ private: void check_inline(bool, bool); bool is_referenced_from(VariableScope) const; InterfaceFlags get_interface_flags(VariableScope) const; + std::string create_type_declaration() const; std::string create_declaration(char = 0, bool = false) const; std::string create_replacement(VariableScope, const char * = 0) const; std::string create_expression(const char * = 0) const; @@ -122,6 +128,7 @@ private: StandardFeatures features; std::list custom_variables; std::string feature_flags; + std::map aliases; bool optimize; static const VariableDefinition standard_variables[]; @@ -136,10 +143,12 @@ public: private: std::string create_source(const std::list &, VariableScope) const; bool evaluate_flags(const char *) const; + static const char *unqualified_name(const char *); static MatchType name_match(const char *, const char *, const char ** = 0); static bool parse_identifier(const char *, unsigned &, unsigned &); static std::vector extract_identifiers(const char *); static std::string replace_identifiers(const char *, const std::map &); + std::string create_expression(const ShaderVariable &, const char * = 0) const; }; } // namespace GL