]> git.tdb.fi Git - libs/gl.git/blob - source/texunit.h
1a4111e6e52569b53bbb003d452aed90c333a2a9
[libs/gl.git] / source / texunit.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_TEXUNIT_H_
9 #define MSP_GL_TEXUNIT_H_
10
11 #include <vector>
12
13 namespace Msp {
14 namespace GL {
15
16 class TexEnv;
17 class Texture;
18
19 class TexUnit
20 {
21 private:
22         const Texture *texture;
23         const TexEnv *texenv;
24
25         static std::vector<TexUnit> units;
26         static TexUnit *cur_unit;
27
28 public:
29         TexUnit();
30
31         bool set_texture(const Texture *);
32         const Texture *get_texture() const { return texture; }
33         bool set_texenv(const TexEnv *);
34         const TexEnv *get_texenv() const { return texenv; }
35
36         static unsigned get_n_units();
37         static TexUnit &activate(unsigned);
38         static TexUnit &current();
39 };
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif