dbf-halloween2015
view src/light.cc @ 4:4316c0c879e9
fixed RUN script for macosx
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 06:18:18 +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 }