]> git.tdb.fi Git - libs/gl.git/blobdiff - source/material.cpp
Drop Id tags and copyright notices from files
[libs/gl.git] / source / material.cpp
index eee1ebc6152057d8799db1a118fa3dcda2bfcd2c..0359ab3f332fd41b90590d229efe0391c7c22c70 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "gl.h"
 #include "material.h"
 
@@ -46,24 +39,21 @@ void Material::set_shininess(float s)
 
 void Material::bind() const
 {
-       if(current!=this)
+       if(set_current(this))
        {
                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);
-               current = this;
        }
 }
 
 void Material::unbind()
 {
-       current = 0;
+       set_current(0);
 }
 
-const Material *Material::current = 0;
-
 
 Material::Loader::Loader(Material &m):
        DataFile::ObjectLoader<Material>(m)