X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmaterial.cc;h=0aa83cdaa8735ae4c16486c14c3bfbefb04d3e3e;hb=13c9481b0430d0bf6fc50b0952bcd81229022abc;hp=962b10c892464e49f7a292fd77763bc5cd45c2d5;hpb=b7c92831285013b2a0783bccaf3d900545ebb5ba;p=laserbrain_demo diff --git a/src/material.cc b/src/material.cc index 962b10c..0aa83cd 100644 --- a/src/material.cc +++ b/src/material.cc @@ -1,11 +1,16 @@ +#include +#include #include "opengl.h" #include "material.h" +#include "sdr.h" +#include "app.h" Material::Material() : diffuse(1.0f, 1.0f, 1.0f) { shininess = 0.0f; alpha = 1.0f; + memset(stdtex, 0, sizeof stdtex); } void Material::setup() const @@ -16,4 +21,22 @@ void Material::setup() const glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, kd); 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