]> git.tdb.fi Git - libs/gl.git/blob - source/texunit.h
Object model for Material and TexEnv
[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 public:
22         TexUnit();
23         bool set_texture(const Texture *);
24         const Texture *get_texture() const { return texture; }
25         bool set_texenv(const TexEnv *);
26         const TexEnv *get_texenv() const { return texenv; }
27
28         static TexUnit &activate(unsigned);
29         static TexUnit &current();
30 private:
31         const Texture *texture;
32         const TexEnv *texenv;
33
34         static std::vector<TexUnit> units;
35         static TexUnit *cur_unit;
36 };
37
38 } // namespace GL
39 } // namespace Msp
40
41 #endif