]> git.tdb.fi Git - libs/gl.git/blob - source/texunit.h
Remove a number of rarely used legacy features
[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 /**
14 Keeps track of texture unit related state.  Mostly for internal use.
15 */
16 class TexUnit
17 {
18 private:
19         unsigned index;
20         const Texture *texture;
21
22         static std::vector<TexUnit> units;
23         static TexUnit *cur_unit;
24
25         TexUnit();
26
27 public:
28         unsigned get_index() const { return index; }
29         bool set_texture(const Texture *);
30         const Texture *get_texture() const { return texture; }
31         void bind();
32
33         static unsigned get_n_units();
34         static TexUnit &get_unit(unsigned);
35         static TexUnit &current();
36         static TexUnit *find_unit(const Texture *);
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif