X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmaterial.cc;h=6288ef4640dcee291a78c33c6534cb54b0f61370;hp=ac8c11247909590c776e2f6fcacacd28fb93daa2;hb=ad052fc67fe4e76d2f4a01b2381a738da1708cdb;hpb=8137121400748ee8afb1608253aae15323c5e3a2 diff --git a/src/material.cc b/src/material.cc index ac8c112..6288ef4 100644 --- a/src/material.cc +++ b/src/material.cc @@ -2,6 +2,8 @@ #include #include "opengl.h" #include "material.h" +#include "sdr.h" +#include "app.h" Material::Material() : diffuse(1.0f, 1.0f, 1.0f) @@ -20,17 +22,79 @@ void Material::setup() const glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, ks); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess); + /* int ntex = std::min((int)textures.size(), 8); // TODO: use max texture units for(int i=0; i::iterator it = std::find(textures.begin(), textures.end(), tex); + if(it != textures.end()) { + textures.erase(it); + } + + for(int i=0; i