Class material_handle¶
Defined in File material.hpp
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
>
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.
-
const std::string &
get_name
() const¶
-
const std::unordered_map<id_type, std::unique_ptr<material_parameter_base>> &
get_params
()¶
-
inline bool
operator==
(const material_handle &other) const¶
-
inline bool
getLoadOrSaveBit
() const¶
-
inline void
setLoadOrSaveBit
(bool canBeSavedOrLoaded)¶
Public Members
-
id_type
id
¶
-
id_type