-void Material::apply() const
-{
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r);
- glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, &emission.r);
- glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
-}
-
-
-Material::Loader::Loader(Material &m):
- mat(m)
-{
- add("ambient", &Loader::ambient);
- add("diffuse", &Loader::diffuse);
- add("specular", &Loader::specular);
- add("emission", &Loader::emission);
- add("shininess", &Material::shininess);
-}
-
-void Material::Loader::ambient(float r, float g, float b, float a)
-{
- mat.ambient=GL::Color(r, g, b, a);
-}
-
-void Material::Loader::diffuse(float r, float g, float b, float a)
-{
- mat.diffuse=GL::Color(r, g, b, a);
-}