]> git.tdb.fi Git - libs/gl.git/blob - source/texunit.h
Fix shadowing warnings from older gcc versions
[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         bool legacy;
21         const Texture *texture;
22
23         static std::vector<TexUnit> units;
24         static TexUnit *cur_unit;
25
26         TexUnit();
27
28 public:
29         unsigned get_index() const { return index; }
30         bool supports_legacy() const { return legacy; }
31         bool set_texture(const Texture *);
32         const Texture *get_texture() const { return texture; }
33         void bind();
34
35         static unsigned get_n_units();
36         static unsigned get_n_legacy_units();
37         static TexUnit &get_unit(unsigned);
38         static TexUnit &current();
39         static TexUnit *find_unit(const Texture *);
40 };
41
42 } // namespace GL
43 } // namespace Msp
44
45 #endif