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

35
src/material.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef MATERIAL_H_
#define MATERIAL_H_
#include <memory>
class Shader;
class Texture;
class Material {
public:
Material(const std::shared_ptr<Texture>& tex = nullptr,
const std::shared_ptr<Shader>& shader = nullptr);
~Material() = default;
[[nodiscard]] const std::shared_ptr<Shader>& shader() const;
[[nodiscard]] std::shared_ptr<Shader>& shader();
void set_shader(const std::shared_ptr<Shader>& shader);
[[nodiscard]] const std::shared_ptr<Texture>& texture() const
{
return texture_;
}
void set_texture(const std::shared_ptr<Texture>& tex)
{
texture_ = tex;
}
void prepare();
private:
std::shared_ptr<Shader> shader_;
std::shared_ptr<Texture> texture_;
};
#endif // MATERIAL_H_