--- /dev/null
+#ifndef MSP_GL_TEXGEN_H_
+#define MSP_GL_TEXGEN_H_
+
+#include "gl.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+enum TexCoordComponent
+{
+ SCOORD = GL_S,
+ TCOORD = GL_T,
+ RCOORD = GL_R,
+ QCOORD = GL_Q
+};
+
+enum TexGenMode
+{
+ EYE_LINEAR = GL_EYE_LINEAR,
+ OBJECT_LINEAR = GL_OBJECT_LINEAR,
+ REFLECTION_MAP = GL_REFLECTION_MAP,
+ NORMAL_MAP = GL_NORMAL_MAP
+};
+
+class TexGen
+{
+private:
+ TexGenMode mode;
+ Vector4 plane;
+
+public:
+ TexGen();
+
+ void set_mode(TexGenMode);
+ void set_plane(const Vector4 &);
+
+ void bind_to(TexCoordComponent) const;
+
+ static const TexGen *current(TexCoordComponent);
+ static void unbind_from(TexCoordComponent);
+private:
+ static unsigned coord_index(TexCoordComponent);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif