feat: assignment 3

This commit is contained in:
2025-10-13 18:23:01 +02:00
parent db6e548476
commit 49219fc597
13 changed files with 364 additions and 61 deletions

View File

@@ -4,8 +4,9 @@
#include <memory>
#include <vector>
#include "material.h"
class Buffer;
class Shader;
class Mesh {
public:
@@ -13,7 +14,7 @@ public:
~Mesh() = default;
void add_buffer(const std::shared_ptr<Buffer>& buffer,
const std::shared_ptr<Shader>& shader = nullptr);
const Material& material);
[[nodiscard]] size_t num_buffers() const
{
@@ -28,11 +29,20 @@ public:
return buffers_[index];
}
[[nodiscard]] const Material& material(size_t index) const
{
return materials_[index];
}
[[nodiscard]] Material& material(size_t index)
{
return materials_[index];
}
void draw();
private:
std::vector<std::shared_ptr<Buffer>> buffers_;
std::vector<std::shared_ptr<Shader>> shaders_;
std::vector<Material> materials_;
};
#endif // MESH_H_