*/
#include "light.h"
+#include "misc.h"
namespace Msp {
namespace GL {
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);
void set_diffuse(const Color &c);
void set_specular(const Color &c);
void set_position(float, float, float, float);
- void apply();
- void apply_to(unsigned);
+ void apply() const;
+ void apply_to(unsigned) const;
static void activate(unsigned);
};