X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flight.cpp;h=5b0fa1d768c0601112ebf9dc91313a961ab49949;hb=a361efc05fcad11b2918f3cd7abdebe794b131d8;hp=1570c5cd0c790840b1232dce96c6631dbbdefbf7;hpb=832fb1872e6e5e664e2e5130122fd2f74729ed42;p=libs%2Fgl.git diff --git a/source/light.cpp b/source/light.cpp index 1570c5cd..5b0fa1d7 100644 --- a/source/light.cpp +++ b/source/light.cpp @@ -6,6 +6,7 @@ Distributed under the LGPL */ #include "light.h" +#include "misc.h" namespace Msp { namespace GL { @@ -43,14 +44,15 @@ void Light::set_position(float x_, float y_, float z_, float w_) w=w_; } -void Light::apply() +void Light::apply() const { apply_to(current); } -void Light::apply_to(unsigned l) +void Light::apply_to(unsigned l) const { l+=GL_LIGHT0; + enable(l); glLightfv(l, GL_AMBIENT, &ambient.r); glLightfv(l, GL_DIFFUSE, &diffuse.r); glLightfv(l, GL_SPECULAR, &specular.r);