]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texunit.h
Rework ProgramData to do less unnecessary work
[libs/gl.git] / source / texunit.h
index 8bcb5f023059cf9ef3ea76e61e3a2a976da5fc8d..9c4d93f6971ea5b60b10b78b367a60a81092a629 100644 (file)
@@ -10,6 +10,9 @@ class TexEnv;
 class TexGen;
 class Texture;
 
+/**
+Keeps track of texture unit related state.  Mostly for internal use.
+*/
 class TexUnit
 {
 private:
@@ -21,9 +24,9 @@ private:
        static std::vector<TexUnit> units;
        static TexUnit *cur_unit;
 
-public:
        TexUnit();
 
+public:
        unsigned get_index() const { return index; }
        bool set_texture(const Texture *);
        const Texture *get_texture() const { return texture; }
@@ -36,6 +39,8 @@ public:
        static unsigned get_n_units();
        static TexUnit &get_unit(unsigned);
        static TexUnit &current();
+       static TexUnit *find_unit(const Texture *);
+       static TexUnit *find_unit(const TexEnv *);
 };
 
 } // namespace GL