12 entt::meta_factory<cull_type>{}
18 .data<cull_type::none>(
"none"_hs)
23 .data<cull_type::clockwise>(
"clockwise"_hs)
28 .data<cull_type::counter_clockwise>(
"counter_clockwise"_hs)
35 entt::meta_factory<material>{}
41 .data<&material::set_cull_type, &material::get_cull_type>(
"cull_type"_hs)
46 .func<&material::get_meta_type>(
"get_meta_type"_hs)
48 .func<&material::as_derived>(
"as_derived"_hs)
54 try_save(ar, ser20::make_nvp(
"cull_type", obj.cull_type_));
61 try_load(ar, ser20::make_nvp(
"cull_type", obj.cull_type_));
66void save_to_file(
const std::string& absolute_path,
const std::shared_ptr<material>& obj)
68 std::ofstream stream(absolute_path);
72 try_save(ar, ser20::make_nvp(
"material", obj));
76void save_to_file_bin(
const std::string& absolute_path,
const std::shared_ptr<material>& obj)
78 std::ofstream stream(absolute_path, std::ios::binary);
82 try_save(ar, ser20::make_nvp(
"material", obj));
86void load_from_file(
const std::string& absolute_path, std::shared_ptr<material>& obj)
88 std::ifstream stream(absolute_path);
92 try_load(ar, ser20::make_nvp(
"material", obj));
98 std::ifstream stream(absolute_path, std::ios::binary);
102 try_load(ar, ser20::make_nvp(
"material", obj));
Base class for materials used in rendering.
attributes::value_type attribute
std::map< std::string, meta_any > attributes
auto create_oarchive_associative(std::ostream &stream)
BinaryInputArchive iarchive_binary_t
auto create_iarchive_associative(std::istream &stream)
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
void save_to_file_bin(const std::string &absolute_path, const animation_clip &obj)
void load_from_file(const std::string &absolute_path, animation_clip &obj)
void save_to_file(const std::string &absolute_path, const animation_clip &obj)
void load_from_file_bin(const std::string &absolute_path, animation_clip &obj)
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool