X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexenv.h;h=c422331aadd8f95285a842d9322fde6241bce16a;hb=67538c60b8baa6816b8ae2d343ae62d881e6c58d;hp=01e4a556b0431cc6ace9e9b3a16d70c60b6b3037;hpb=abc16c5ab0fff0945d724febe9d5d3889fb8a6ce;p=libs%2Fgl.git diff --git a/source/texenv.h b/source/texenv.h index 01e4a556..c422331a 100644 --- a/source/texenv.h +++ b/source/texenv.h @@ -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,35 @@ enum TexEnvMode class TexEnv { private: + enum ParameterMask + { + MODE = 1, + COLOR = 2 + }; + TexEnvMode mode; Color color; public: TexEnv(); + ~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() const; + 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