assimp
[laserbrain_demo] / src / material.cc
1 #include "opengl.h"
2 #include "material.h"
3
4 Material::Material()
5         : diffuse(1.0f, 1.0f, 1.0f)
6 {
7         shininess = 0.0f;
8         alpha = 1.0f;
9 }
10
11 void Material::setup() const
12 {
13         float kd[] = {diffuse.x, diffuse.y, diffuse.z, alpha};
14         float ks[] = {specular.x, specular.y, specular.z, 1.0f};
15
16         glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, kd);
17         glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, ks);
18         glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
19 }