feat: assignment 3
This commit is contained in:
16
src/mesh.h
16
src/mesh.h
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user