]> git.tdb.fi Git - libs/gl.git/blobdiff - source/light.h
Convert Light to object model
[libs/gl.git] / source / light.h
index 6a6868412f7614a70e2241f02f2871d2d0077437..e9b032694565e7e857e32fada5d84a0d70013505 100644 (file)
@@ -8,6 +8,7 @@ Distributed under the LGPL
 #ifndef MSP_GL_LIGHT_H_
 #define MSP_GL_LIGHT_H_
 
+#include <vector>
 #include "color.h"
 
 namespace Msp {
@@ -25,7 +26,8 @@ private:
        float spot_cutoff;
        float attenuation[3];
 
-       static unsigned current;
+       static unsigned current_unit;
+       static std::vector<const Light *> current_lights;
 
 public:
        Light();
@@ -33,10 +35,11 @@ public:
        void set_diffuse(const Color &c);
        void set_specular(const Color &c);
        void set_position(float, float, float, float);
-       void apply() const;
-       void apply_to(unsigned) const;
+       void bind() const;
+       void bind_to(unsigned) const;
 
        static void activate(unsigned);
+       static void unbind();
 };
 
 } // namespace GL