]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texenv.cpp
Remove a number of rarely used legacy features
[libs/gl.git] / source / texenv.cpp
diff --git a/source/texenv.cpp b/source/texenv.cpp
deleted file mode 100644 (file)
index c8af55f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#include "texenv.h"
-#include "texunit.h"
-
-namespace Msp {
-namespace GL {
-
-TexEnv::TexEnv():
-       mode(MODULATE),
-       color(0, 0, 0, 0)
-{ }
-
-TexEnv::~TexEnv()
-{
-       if(this!=&default_object())
-       {
-               while(TexUnit *unit = TexUnit::find_unit(this))
-                       unbind_from(unit->get_index());
-       }
-}
-
-const TexEnv &TexEnv::default_object()
-{
-       static TexEnv obj;
-       return obj;
-}
-
-void TexEnv::update_parameter(int mask) const
-{
-       if(TexUnit::current().get_texenv()!=this)
-       {
-               TexUnit *unit = TexUnit::find_unit(this);
-               if(!unit)
-                       return;
-
-               unit->bind();
-       }
-
-       if(mask&MODE)
-               glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode);
-       if(mask&COLOR)
-               glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &color.r);
-}
-
-void TexEnv::set_mode(TexEnvMode m)
-{
-       mode = m;
-       update_parameter(MODE);
-}
-
-void TexEnv::set_color(const Color &c)
-{
-       color = c;
-       update_parameter(COLOR);
-}
-
-void TexEnv::bind_to(unsigned i) const
-{
-       TexUnit &unit = TexUnit::get_unit(i);
-       if(unit.set_texenv(this))
-       {
-               unit.bind();
-               update_parameter(-1);
-       }
-}
-
-const TexEnv *TexEnv::current(unsigned i)
-{
-       return TexUnit::get_unit(i).get_texenv();
-}
-
-void TexEnv::unbind_from(unsigned i)
-{
-       default_object().bind_to(i);
-}
-
-} // namespace GL
-} // namespace Msp