Add Light::unbind_from function
}
}
+void Light::unbind_from(unsigned i)
+{
+ activate(i);
+ unbind();
+}
+
unsigned Light::current_unit = 0;
vector<const Light *> Light::current_lights(1);
static void activate(unsigned);
static void unbind();
+ static void unbind_from(unsigned);
};
} // namespace GL
if(!set_current(this))
return;
- enable(LIGHTING);
+ enable(GL_LIGHTING);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &ambient.r);
for(unsigned i=0; i<lights.size(); ++i)
if(lights[i])
for(unsigned i=0; i<old->lights.size(); ++i)
if(old->lights[i])
- {
- Light::activate(i);
- Light::unbind();
- }
- disable(LIGHTING);
+ Light::unbind_from(i);
+
+ disable(GL_LIGHTING);
}
} // namespace GL
class Light;
-enum
-{
- LIGHTING = GL_LIGHTING
-};
-
/**
Encapsulates global lighting parameters and a number of individual lights.
*/