]> git.tdb.fi Git - libs/gl.git/blob - source/lightunit.h
Rewrite light binding to match textures
[libs/gl.git] / source / lightunit.h
1 #ifndef MSP_GL_LIGHTUNIT_H_
2 #define MSP_GL_LIGHTUNIT_H_
3
4 #include <vector>
5
6 namespace Msp {
7 namespace GL {
8
9 class Light;
10
11 class LightUnit
12 {
13 private:
14         unsigned index;
15         const Light *light;
16
17         static std::vector<LightUnit> units;
18         static LightUnit *cur_unit;
19
20         LightUnit();
21
22 public:
23         unsigned get_index() const { return index; }
24         bool set_light(const Light *);
25         const Light *get_light() const { return light; }
26
27         static unsigned get_n_units();
28         static LightUnit &get_unit(unsigned i);
29 };
30
31 } // namespace GL
32 } // namespace Msp
33
34 #endif