class Light
{
private:
- Color ambient;
Color diffuse;
Color specular;
Vector4 position;
float spot_cutoff;
float attenuation[3];
- static unsigned current_unit;
- static std::vector<const Light *> current_lights;
-
public:
Light();
- void set_ambient(const Color &c);
void set_diffuse(const Color &c);
void set_specular(const Color &c);
- const Color &get_ambient() const { return ambient; }
const Color &get_diffuse() const { return diffuse; }
const Color &get_specular() const { return specular; }
void set_attenuation(float, float, float);
const float *get_attenuation() const { return attenuation; }
- void bind() const;
+ void bind() const { return bind_to(0); }
void bind_to(unsigned) const;
- static void activate(unsigned);
- static void unbind();
+ static const Light *current(unsigned = 0);
+ static void unbind() { return unbind_from(0); }
static void unbind_from(unsigned);
};