]> git.tdb.fi Git - libs/gl.git/blob - source/texunit.h
Add TexGen wrapper class
[libs/gl.git] / source / texunit.h
1 #ifndef MSP_GL_TEXUNIT_H_
2 #define MSP_GL_TEXUNIT_H_
3
4 #include <vector>
5
6 namespace Msp {
7 namespace GL {
8
9 class TexEnv;
10 class TexGen;
11 class Texture;
12
13 class TexUnit
14 {
15 private:
16         const Texture *texture;
17         const TexEnv *texenv;
18         const TexGen *texgen[4];
19
20         static std::vector<TexUnit> units;
21         static TexUnit *cur_unit;
22
23 public:
24         TexUnit();
25
26         bool set_texture(const Texture *);
27         const Texture *get_texture() const { return texture; }
28         bool set_texenv(const TexEnv *);
29         const TexEnv *get_texenv() const { return texenv; }
30         bool set_texgen(unsigned, const TexGen *);
31         const TexGen *get_texgen(unsigned);
32
33         static unsigned get_n_units();
34         static TexUnit &activate(unsigned);
35         static TexUnit &current();
36 };
37
38 } // namespace GL
39 } // namespace Msp
40
41 #endif