Class material

Class Documentation

class legion::rendering::material

Structure that keeps track of the parameterization of a certain shader. Multiple material instances can use the same shader but use different parameter values.

Public Functions

id_type current_variant() const
bool has_variant(id_type variantId) const
bool has_variant(const std::string &variant) const
void set_variant(id_type variantId)
void set_variant(const std::string &variant)
void bind()

Bind the material to the rendering context and prepare for use.

inline void release()

Release the material from the rendering context.

template<typename T>
void set_param(const std::string &name, const T &value)

Set the value of a parameter by name.

template<typename T>
bool has_param(const std::string &name)

Check if the material has a parameter by name.

template<typename T>
T get_param(const std::string &name)

Get the value of a parameter by name.

template<typename T>
void set_param(GLint location, const T &value)

Set the value of a parameter by location.

template<typename T>
bool has_param(GLint location)

Check if the material has a parameter by location.

template<typename T>
T get_param(GLint location)

Get the value of a parameter by location.

inline attribute get_attribute(const std::string &name)

Get attribute bound to a certain name.

inline const std::string &get_name()
inline const std::unordered_map<id_type, std::unique_ptr<material_parameter_base>> &get_params()
void make_unsavable()

Friends

friend class MaterialCache
friend struct material_handle