]> git.tdb.fi Git - libs/gl.git/blobdiff - source/material.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / material.cpp
diff --git a/source/material.cpp b/source/material.cpp
deleted file mode 100644 (file)
index f165c74..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include "material.h"
-
-namespace Msp {
-namespace GL {
-
-Material::Material():
-       ambient(0.2),
-       diffuse(0.8),
-       specular(0),
-       emission(0),
-       shininess(0)
-{ }
-
-void Material::set_ambient(const Color &a)
-{
-       ambient=a;
-}
-
-void Material::set_diffuse(const Color &d)
-{
-       diffuse=d;
-}
-
-void Material::set_specular(const Color &s)
-{
-       specular=s;
-}
-
-void Material::set_emission(const Color &e)
-{
-       emission=e;
-}
-
-void Material::set_shininess(float s)
-{
-       shininess=s;
-}
-
-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);
-}
-
-void Material::Loader::specular(float r, float g, float b, float a)
-{
-       mat.specular=GL::Color(r, g, b, a);
-}
-
-void Material::Loader::emission(float r, float g, float b, float a)
-{
-       mat.emission=GL::Color(r, g, b, a);
-}
-
-} // namespace GL
-} // namespace Msp