]> git.tdb.fi Git - libs/gl.git/blobdiff - source/lighting.h
Don't store ProgramData in Lighting
[libs/gl.git] / source / lighting.h
index 85d5fb0406c877cb0d89e855cc6d6cff2b90a384..593d8039fe5c8365269b757f963173b14289cd51 100644 (file)
@@ -1,38 +1,26 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_LIGHTING_H_
 #define MSP_GL_LIGHTING_H_
 
 #include <vector>
+#include "bindable.h"
 #include "color.h"
 #include "gl.h"
+#include "programdata.h"
 
 namespace Msp {
 namespace GL {
 
 class Light;
 
-enum
-{
-       LIGHTING = GL_LIGHTING
-};
-
 /**
 Encapsulates global lighting parameters and a number of individual lights.
 */
-class Lighting
+class Lighting: public Bindable<Lighting>
 {
 private:
        Color ambient;
        std::vector<const Light *> lights;
 
-       static const Lighting *current;
-
 public:
        Lighting();
 
@@ -41,6 +29,8 @@ public:
 
        void attach(unsigned, const Light &);
        void detach(unsigned);
+
+       void update_shader_data(ProgramData &, const Matrix &) const;
        void bind() const;
 
        static void unbind();