X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmaterial.cc;h=ac8c11247909590c776e2f6fcacacd28fb93daa2;hp=962b10c892464e49f7a292fd77763bc5cd45c2d5;hb=8137121400748ee8afb1608253aae15323c5e3a2;hpb=516e9be0443cfd7f844feb9b8299f909075b7c3c 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