-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.h
53 lines (45 loc) · 1.78 KB
/
Material.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef _MATERIAL_H_
#define _MATERIAL_H_
// Includes
#include "GLInclude.h"
#include <fstream>
#include <sstream>
#include <memory>
#include "Image.h"
////////////////////////////////////////////////////////////////////////////////
/// @class Class for storing materials
////////////////////////////////////////////////////////////////////////////////
class Material{
public:
////////////////////////////////////////////////////////////////////////////
/// @brief Constructor for material
/// @param _name The name of the material
/// @param _kd Diffuse value for materials
/// @param _ka Ambient value for materials
/// @param _ks Specular value for materials
/// @param image_tag Image tag for diffuse map
Material(std::string _name, glm::vec3 _kd, glm::vec3 _ka, glm::vec3 _ks,
std::string image_tag);
////////////////////////////////////////////////////////////////////////////
/// @brief 2nd constructor for material
Material(const Material &_oldMat);
////////////////////////////////////////////////////////////////////////////
/// @brief Initialization
void Initialize();
////////////////////////////////////////////////////////////////////////////
/// @brief Drawing of material
/// @param _program Shader program for rendering
void Draw(GLuint _program);
private:
glm::vec3 ka; //< Ambient factor
glm::vec3 ks; //< Specular factor
glm::vec3 kd; //< Diffuse factor
std::string mat_name; //< Material
std::string image_tag; //< Texture location
std::unique_ptr<Image> image; //< Texture
GLuint texture{0}; //< GL Image storage
////////////////////////////////////////////////////////////////////////////
/// @brief Parse data
void Parse (const std::string& location);
};
#endif