X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Flighting.cpp;h=aae5d331384919e0af9f8523523eda56a5273bab;hp=0af2416c14729788d411e747b91e8bcedfa0303c;hb=126161d1d44ab9503bc747d24a07b7b9d15e527a;hpb=dcd8bd3a16a4af8e77aa84877b3f8a4fb03b8c7e diff --git a/source/lighting.cpp b/source/lighting.cpp index 0af2416c..aae5d331 100644 --- a/source/lighting.cpp +++ b/source/lighting.cpp @@ -20,6 +20,8 @@ void Lighting::attach(unsigned i, const Light &l) lights.resize(i+1); lights[i] = &l; + if(current()==this) + l.bind_to(i); } void Lighting::detach(unsigned i) @@ -28,6 +30,8 @@ void Lighting::detach(unsigned i) return; lights[i] = 0; + if(current()==this) + Light::unbind_from(i); } void Lighting::bind() const