Код: Выделить всё
struct Material {
std::shared_ptr texture1;
std::shared_ptr texture2;
};
Код: Выделить всё
class Texture {
std::string id_; // Guaranteed to be unique
};
class TextureManager {
public:
std::shared_ptr get_texture_by_id(std::string_view id);
private:
std::unordered_map textures_;
};
Код: Выделить всё
{
"texture1": "/assets/dog.bmp",
"texture2": "/assets/foo.jpg"
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... -in-cereal