X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmaterial.cc;h=ac8c11247909590c776e2f6fcacacd28fb93daa2;hb=3bfa17f584d9b6ad0bcb468c85b815c5046d7250;hp=962b10c892464e49f7a292fd77763bc5cd45c2d5;hpb=b7c92831285013b2a0783bccaf3d900545ebb5ba;p=laserbrain_demo diff --git a/src/material.cc b/src/material.cc index 962b10c..ac8c112 100644 --- a/src/material.cc +++ b/src/material.cc @@ -1,3 +1,5 @@ +#include +#include #include "opengl.h" #include "material.h" @@ -6,6 +8,7 @@ Material::Material() { shininess = 0.0f; alpha = 1.0f; + memset(stdtex, 0, sizeof stdtex); } void Material::setup() const @@ -16,4 +19,18 @@ 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