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::CollectionObjectLoader<Material>
26 Loader(Material &, Collection &);
30 Color make_color(float, float, float, float);
31 void ambient(float, float, float, float);
32 void diffuse(float, float, float, float);
33 void specular(float, float, float, float);
34 void emission(float, float, float, float);
35 void shininess(float);
59 void update_parameter(int) const;
62 void set_ambient(const Color &a);
63 void set_diffuse(const Color &d);
64 void set_specular(const Color &s);
65 void set_emission(const Color &e);
66 void set_shininess(float s);
67 const Color &get_ambient() const { return ambient; }
68 const Color &get_diffuse() const { return diffuse; }
69 const Color &get_specular() const { return specular; }
70 const Color &get_emission() const { return emission; }
71 float get_shininess() const { return shininess; }
72 const ProgramData &get_shader_data() const { return shdata; }