X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flighting.cpp;h=aae5d331384919e0af9f8523523eda56a5273bab;hb=a86623004ba91baef76dac9275e9b79366acce16;hp=0af2416c14729788d411e747b91e8bcedfa0303c;hpb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;p=libs%2Fgl.git 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