]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texgen.cpp
Remove a number of rarely used legacy features
[libs/gl.git] / source / texgen.cpp
diff --git a/source/texgen.cpp b/source/texgen.cpp
deleted file mode 100644 (file)
index 4310d19..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <stdexcept>
-#include "misc.h"
-#include "texgen.h"
-#include "texunit.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-TexGen::TexGen():
-       mode(EYE_LINEAR)
-{ }
-
-TexGen::~TexGen()
-{
-       // TODO unbind
-}
-
-void TexGen::set_mode(TexGenMode m)
-{
-       mode = m;
-}
-
-void TexGen::set_plane(const Vector4 &p)
-{
-       plane = p;
-}
-
-void TexGen::bind_to(unsigned i, TexCoordComponent c) const
-{
-       TexUnit &unit = TexUnit::get_unit(i);
-       if(unit.set_texgen(coord_index(c), this))
-       {
-               unit.bind();
-               glTexGeni(c, GL_TEXTURE_GEN_MODE, mode);
-               if(mode==EYE_LINEAR)
-                       glTexGenfv(c, GL_EYE_PLANE, &plane.x);
-               else if(mode==OBJECT_LINEAR)
-                       glTexGenfv(c, GL_OBJECT_PLANE, &plane.x);
-               enable(GL_TEXTURE_GEN_S+coord_index(c));
-       }
-}
-
-const TexGen *TexGen::current(unsigned i, TexCoordComponent c)
-{
-       return TexUnit::get_unit(i).get_texgen(coord_index(c));
-}
-
-void TexGen::unbind_from(unsigned i, TexCoordComponent c)
-{
-       TexUnit &unit = TexUnit::get_unit(i);
-       if(unit.set_texgen(coord_index(c), 0))
-       {
-               unit.bind();
-               disable(GL_TEXTURE_GEN_S+coord_index(c));
-       }
-}
-
-unsigned TexGen::coord_index(TexCoordComponent c)
-{
-       switch(c)
-       {
-       case SCOORD: return 0;
-       case TCOORD: return 1;
-       case RCOORD: return 2;
-       case QCOORD: return 3;
-       default: throw invalid_argument("TexGen::coord_index");
-       }
-}
-
-} // namespace GL
-} // namespace Msp