Class material_handle

Class Documentation

class legion::rendering::material_handle

Cheap and safe to pass around handle to a certain material. Can be treated like a null-able reference, nullify by setting it to invalid_material_handle. material.

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)
shader_handle get_shader()
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.

const std::string &get_name() const
const std::unordered_map<id_type, std::unique_ptr<material_parameter_base>> &get_params()
attribute get_attribute(const std::string &name)

Get attribute bound to a certain name.

inline bool operator==(const material_handle &other) const
template<class Archive>
void save(Archive &oa) const
template<class Archive>
void load(Archive &oa)
inline bool getLoadOrSaveBit() const
inline void setLoadOrSaveBit(bool canBeSavedOrLoaded)

Public Members

id_type id