X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexenv.h;h=1327bb850de64999e297f504b82489811164104c;hb=6fd9b09f47ff6a07bd5ca7f9e8887db3486bfcb1;hp=8a341db331e13371939fbd7216499e3cc76b10df;hpb=7adcad3b40a03000a82e32db4523761c218309b8;p=libs%2Fgl.git diff --git a/source/texenv.h b/source/texenv.h index 8a341db3..1327bb85 100644 --- a/source/texenv.h +++ b/source/texenv.h @@ -1,11 +1,40 @@ #ifndef MSP_GL_TEXENV_H_ #define MSP_GL_TEXENV_H_ +#include "color.h" +#include "gl.h" + namespace Msp { namespace GL { +enum TexEnvMode +{ + REPLACE = GL_REPLACE, + MODULATE = GL_MODULATE, + DECAL = GL_DECAL, + BLEND = GL_BLEND, + ADD = GL_ADD, + COMBINE = GL_COMBINE +}; + class TexEnv { +private: + TexEnvMode mode; + Color color; + +public: + TexEnv(); + 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 { bind_to(0); } + void bind_to(unsigned) const; + + static const TexEnv *current(unsigned = 0); + static void unbind() { unbind_from(0); } + static void unbind_from(unsigned); }; } // namespace GL