ld33_umonster

view src/light.cc @ 2:35349df5392d

wtf?
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Aug 2015 23:55:21 +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 }