]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texunit.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / texunit.cpp
diff --git a/source/texunit.cpp b/source/texunit.cpp
deleted file mode 100644 (file)
index 4d71e3b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <stdexcept>
-#include "extension.h"
-#include "gl.h"
-#include "texunit.h"
-#include "version_1_3.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-vector<TexUnit> TexUnit::units;
-TexUnit *TexUnit::cur_unit = 0;
-
-TexUnit::TexUnit():
-       texture(0),
-       texenv(0)
-{ }
-
-bool TexUnit::set_texture(const Texture *tex)
-{
-       bool result = (tex!=texture);
-       texture = tex;
-       return result;
-}
-
-bool TexUnit::set_texenv(const TexEnv *env)
-{
-       bool result = (texenv!=env);
-       texenv = env;
-       return result;
-}
-
-unsigned TexUnit::get_n_units()
-{
-       static int count = -1;
-       if(count<0)
-       {
-               if(is_version_at_least(2, 0) || is_supported("ARB_vertex_shader"))
-                       glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &count);
-               else if(is_version_at_least(1, 3))
-                       glGetIntegerv(GL_MAX_TEXTURE_UNITS, &count);
-               else
-                       count = 1;
-       }
-       return count;
-}
-
-TexUnit &TexUnit::activate(unsigned n)
-{
-       if(n>=get_n_units())
-               throw out_of_range("TexUnit::activate");
-
-       if(units.size()<=n)
-               units.resize(n+1);
-
-       if(cur_unit!=&units[n] && (cur_unit || n))
-               glActiveTexture(GL_TEXTURE0+n);
-       cur_unit = &units[n];
-
-       return units[n];
-}
-
-TexUnit &TexUnit::current()
-{
-       if(!cur_unit)
-               return activate(0);
-       return *cur_unit;
-}
-
-} // namespace GL
-} // namespace Msp