Class material¶
Defined in File material.hpp
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
>
voidset_param
(const std::string &name, const T &value)¶ Set the value of a parameter by name.
-
template<typename
T
>
boolhas_param
(const std::string &name)¶ Check if the material has a parameter by name.
-
template<typename
T
>
voidset_param
(GLint location, const T &value)¶ Set the value of a parameter by location.
-
template<typename
T
>
boolhas_param
(GLint location)¶ Check if the material has a parameter by location.
-
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
-
id_type