]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texenv.h
Foundation for a resource management system
[libs/gl.git] / source / texenv.h
index b5fee448d64e5cce152ca4eaa3566e3d4f0c9370..61f700854b50030e43297b96310aa106622a36fb 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_TEXENV_H_
 #define MSP_GL_TEXENV_H_
 
@@ -27,18 +20,34 @@ enum TexEnvMode
 class TexEnv
 {
 private:
+       enum ParameterMask
+       {
+               MODE = 1,
+               COLOR = 2
+       };
+
        TexEnvMode mode;
        Color color;
 
 public:
        TexEnv();
+
+       static const TexEnv &default_object();
+
+private:
+       void update_parameter(int) const;
+
+public:
        void set_mode(TexEnvMode);
        void set_color(const Color &);
        TexEnvMode get_mode() const { return mode; }
        const Color &get_color() const { return color; }
-       void bind();
+       void bind() const { bind_to(0); }
+       void bind_to(unsigned) const;
 
-       static void unbind();
+       static const TexEnv *current(unsigned = 0);
+       static void unbind() { unbind_from(0); }
+       static void unbind_from(unsigned);
 };
 
 } // namespace GL