X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fblend.h;h=3d7368bb8bfeda7c27c92aaa07172f5ae10111d9;hb=5172d32d67595ea0b70184fadcfcb8e023cccbc8;hp=27e76d6469ccb7ea6ab52aee8cb00e29dcdef5a5;hpb=e3ca5a12fd2a3e751ffc86b743c8a43a2ba54edc;p=libs%2Fgl.git diff --git a/source/blend.h b/source/blend.h index 27e76d64..3d7368bb 100644 --- a/source/blend.h +++ b/source/blend.h @@ -1,23 +1,19 @@ /* $Id$ This file is part of libmspgl -Copyright © 2008 Mikko Rasa, Mikkosoft Productions +Copyright © 2008, 2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #ifndef MSP_GL_BLEND_H_ #define MSP_GL_BLEND_H_ +#include "bindable.h" #include "gl.h" namespace Msp { namespace GL { -enum -{ - BLEND = GL_BLEND -}; - enum BlendEquation { ADD = GL_FUNC_ADD, @@ -45,8 +41,27 @@ enum BlendFactor ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA }; -void blend_equation(BlendEquation eq); -void blend_func(BlendFactor src, BlendFactor dst); +/** +Blends incoming fragments with those already in the framebuffer. +*/ +class Blend: public Bindable +{ +private: + BlendEquation eq; + BlendFactor src_factor; + BlendFactor dst_factor; + +public: + Blend(); + Blend(BlendFactor, BlendFactor); + Blend(BlendEquation, BlendFactor, BlendFactor); + + void bind() const; + + static void unbind(); + + static const Blend &alpha(); +}; } // namespace GL } // namespace Msp