]> git.tdb.fi Git - libs/gl.git/blob - source/texgen.h
bb076c629ddb2ea7ea50d8b1b1f1cb64e1b11391
[libs/gl.git] / source / texgen.h
1 #ifndef MSP_GL_TEXGEN_H_
2 #define MSP_GL_TEXGEN_H_
3
4 #include "gl.h"
5 #include "vector.h"
6
7 namespace Msp {
8 namespace GL {
9
10 enum TexCoordComponent
11 {
12         SCOORD = GL_S,
13         TCOORD = GL_T,
14         RCOORD = GL_R,
15         QCOORD = GL_Q
16 };
17
18 enum TexGenMode
19 {
20         EYE_LINEAR = GL_EYE_LINEAR,
21         OBJECT_LINEAR = GL_OBJECT_LINEAR,
22         REFLECTION_MAP = GL_REFLECTION_MAP,
23         NORMAL_MAP = GL_NORMAL_MAP
24 };
25
26 class TexGen
27 {
28 private:
29         TexGenMode mode;
30         Vector4 plane;
31
32 public:
33         TexGen();
34
35         void set_mode(TexGenMode);
36         void set_plane(const Vector4 &);
37
38         void bind_to(TexCoordComponent) const;
39
40         static const TexGen *current(TexCoordComponent);
41         static void unbind_from(TexCoordComponent);
42 private:
43         static unsigned coord_index(TexCoordComponent);
44 };
45
46 } // namespace GL
47 } // namespace Msp
48
49 #endif