ld33_umonster

view src/light.cc @ 10:1b30bd381667

sweep curve mesh gen and dragon horns
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 27 Aug 2015 05:25:04 +0300
parents
children
line source
1 #include "light.h"
2 #include "opengl.h"
4 Light::Light()
5 : color(1, 1, 1)
6 {
7 }
9 void Light::setup(int idx) const
10 {
11 float lpos[] = {pos.x, pos.y, pos.z, 1.0};
12 float col[] = {color.x, color.y, color.z, 1.0};
14 glLightfv(GL_LIGHT0 + idx, GL_POSITION, lpos);
15 glLightfv(GL_LIGHT0 + idx, GL_DIFFUSE, col);
16 glLightfv(GL_LIGHT0 + idx, GL_SPECULAR, col);
17 }