]> git.tdb.fi Git - libs/gl.git/blobdiff - source/lightunit.h
Rewrite light binding to match textures
[libs/gl.git] / source / lightunit.h
diff --git a/source/lightunit.h b/source/lightunit.h
new file mode 100644 (file)
index 0000000..3f65d77
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef MSP_GL_LIGHTUNIT_H_
+#define MSP_GL_LIGHTUNIT_H_
+
+#include <vector>
+
+namespace Msp {
+namespace GL {
+
+class Light;
+
+class LightUnit
+{
+private:
+       unsigned index;
+       const Light *light;
+
+       static std::vector<LightUnit> units;
+       static LightUnit *cur_unit;
+
+       LightUnit();
+
+public:
+       unsigned get_index() const { return index; }
+       bool set_light(const Light *);
+       const Light *get_light() const { return light; }
+
+       static unsigned get_n_units();
+       static LightUnit &get_unit(unsigned i);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif