dbf-halloween2015

view src/light.cc @ 3:c37fe5d8a4ed

windows port
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Nov 2015 06:04:28 +0200
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 }