namespace Msp {
namespace GL {
+class Matrix;
+class ProgramData;
+
class Light
{
private:
+ enum ParameterMask
+ {
+ DIFFUSE = 1,
+ SPECULAR = 2,
+ POSITION = 4,
+ SPOT_DIR = 8,
+ SPOT_EXP = 16,
+ SPOT_CUTOFF = 32,
+ ATTENUATION = 64
+ };
+
Color diffuse;
Color specular;
Vector4 position;
public:
Light();
+private:
+ void update_parameter(int, int = -1) const;
+
+public:
void set_diffuse(const Color &c);
void set_specular(const Color &c);
const Color &get_diffuse() const { return diffuse; }
void set_attenuation(float, float, float);
const float *get_attenuation() const { return attenuation; }
+ void update_shader_data(ProgramData &, const Matrix &, unsigned) const;
void bind() const { return bind_to(0); }
void bind_to(unsigned) const;