1 #ifndef MSP_GL_MATERIAL_H_
2 #define MSP_GL_MATERIAL_H_
4 #include <msp/datafile/objectloader.h>
7 #include "programdata.h"
13 Stores OpenGL material properties. Since OpenGL does not support material
14 objects, application of material is done with several calls to glMaterial.
16 class Material: public BindableWithDefault<Material>
19 class Loader: public DataFile::ObjectLoader<Material>
25 void ambient(float, float, float, float);
26 void diffuse(float, float, float, float);
27 void specular(float, float, float, float);
28 void emission(float, float, float, float);
29 void shininess(float);
53 void update_parameter(int) const;
56 void set_ambient(const Color &a);
57 void set_diffuse(const Color &d);
58 void set_specular(const Color &s);
59 void set_emission(const Color &e);
60 void set_shininess(float s);
61 const Color &get_ambient() const { return ambient; }
62 const Color &get_diffuse() const { return diffuse; }
63 const Color &get_specular() const { return specular; }
64 const Color &get_emission() const { return emission; }
65 float get_shininess() const { return shininess; }
66 const ProgramData &get_shader_data() const { return shdata; }