dbf-halloween2015
annotate src/light.cc @ 0:50683c78264e
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 00:09:12 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 #include "light.h" |
nuclear@0 | 2 #include "opengl.h" |
nuclear@0 | 3 |
nuclear@0 | 4 Light::Light() |
nuclear@0 | 5 : color(1, 1, 1) |
nuclear@0 | 6 { |
nuclear@0 | 7 } |
nuclear@0 | 8 |
nuclear@0 | 9 void Light::setup(int idx) const |
nuclear@0 | 10 { |
nuclear@0 | 11 float lpos[] = {pos.x, pos.y, pos.z, 1.0}; |
nuclear@0 | 12 float col[] = {color.x, color.y, color.z, 1.0}; |
nuclear@0 | 13 |
nuclear@0 | 14 glLightfv(GL_LIGHT0 + idx, GL_POSITION, lpos); |
nuclear@0 | 15 glLightfv(GL_LIGHT0 + idx, GL_DIFFUSE, col); |
nuclear@0 | 16 glLightfv(GL_LIGHT0 + idx, GL_SPECULAR, col); |
nuclear@0 | 17 } |