X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterial.cpp;h=a2814cff1ad6ccfdac3347e14f5a3ce130451e45;hp=58cd15cb8e122169803ce5015be54681df948173;hb=HEAD;hpb=cea3c333797cadd9629aefaa5b82243173a02d16 diff --git a/source/material.cpp b/source/material.cpp deleted file mode 100644 index 58cd15cb..00000000 --- a/source/material.cpp +++ /dev/null @@ -1,56 +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); -} - -} // namespace GL -} // namespace Msp