X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fblend.h;h=e04aef49c2474cc7be4c49382044518331a6c9a2;hb=160e9eea29bd10034733d59507fa1bcca36be401;hp=ad7ba241bd1b1028e7e1bea45b5477f6b66245f6;hpb=24b24e2203c776aacd9744bb947f5cf47b03d328;p=libs%2Fgl.git diff --git a/source/core/blend.h b/source/core/blend.h index ad7ba241..e04aef49 100644 --- a/source/core/blend.h +++ b/source/core/blend.h @@ -35,6 +35,16 @@ enum BlendFactor ONE_MINUS_CONSTANT_ALPHA }; +enum ColorWriteMask +{ + WRITE_NONE = 0, + WRITE_RED = 1, + WRITE_GREEN = 2, + WRITE_BLUE = 4, + WRITE_ALPHA = 8, + WRITE_ALL = 15 +}; + /** Blends incoming fragments with those already in the framebuffer. */ @@ -56,14 +66,16 @@ struct Blend BlendFactor src_factor; BlendFactor dst_factor; Color constant; + ColorWriteMask write_mask; Blend(); Blend(BlendFactor, BlendFactor); Blend(BlendEquation, BlendFactor, BlendFactor); }; -unsigned get_gl_blend_equation(BlendEquation); -unsigned get_gl_blend_factor(BlendFactor); + +inline ColorWriteMask operator|(ColorWriteMask m1, ColorWriteMask m2) +{ return static_cast(static_cast(m1)|static_cast(m2)); } void operator>>(const LexicalConverter &, BlendEquation &); void operator<<(LexicalConverter &, BlendEquation); @@ -71,7 +83,12 @@ void operator<<(LexicalConverter &, BlendEquation); void operator>>(const LexicalConverter &, BlendFactor &); void operator<<(LexicalConverter &, BlendFactor); +void operator>>(const LexicalConverter &, ColorWriteMask &); +void operator<<(LexicalConverter &, ColorWriteMask); + } // namespace GL } // namespace Msp +#include "blend_backend.h" + #endif