X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogrambuilder.h;h=053eb567487a9a03964235a5d04b3d84c555a68c;hp=ecd006d552709eec6656a3409efe47b5bb6afa51;hb=f141ae14619bfbd51a7e6871c55edbdd17ac3417;hpb=bbd21944fae06f134625b2f5595c3aab36c3aa9e diff --git a/source/programbuilder.h b/source/programbuilder.h index ecd006d5..053eb567 100644 --- a/source/programbuilder.h +++ b/source/programbuilder.h @@ -88,7 +88,7 @@ public: bool specular; /** Use a normal map texture. Only used if lighting is true. */ - bool normalmap; + bool normal_map; /** Use a shadow map. Requires a ShadowMap effect or equivalent in the pipeline. */ @@ -98,6 +98,15 @@ public: equivalend in the pipeline. */ bool reflection; + /** Clip primitives against user defined clip planes. */ + bool clipping; + + /** Number of clipping planes to process. */ + unsigned max_clip_planes; + + /** Use a geometry shader. */ + bool geometry; + /** Force the use of legacy shaders conforming to GLSL 1.10. Defaults to true if the version of GLSL is less than 1.30, false otherwise. */ bool legacy; @@ -115,10 +124,13 @@ private: { NO_SCOPE, TYPE, + FUNCTION, UNIFORM, ATTRIBUTE, VERTEX, - FRAGMENT + GEOMETRY, + FRAGMENT, + N_SCOPES }; enum InterfaceFlags @@ -170,8 +182,8 @@ private: 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; + std::string create_replacement(VariableScope, unsigned, const char * = 0) const; + std::string create_expression(unsigned, const char * = 0) const; }; enum MatchType @@ -185,6 +197,7 @@ private: StandardFeatures features; std::list custom_variables; std::string feature_flags; + unsigned enabled_scopes; std::map aliases; bool optimize; @@ -211,6 +224,7 @@ private: 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 &, bool = false); + static VariableScope previous_scope(VariableScope, unsigned); std::string create_expression(const ShaderVariable &, const char * = 0) const; };