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