1 #ifndef MSP_GL_BLEND_H_
2 #define MSP_GL_BLEND_H_
4 #include <msp/datafile/objectloader.h>
5 #include <msp/strings/lexicalcast.h>
33 ONE_MINUS_CONSTANT_COLOR,
35 ONE_MINUS_CONSTANT_ALPHA
49 Blends incoming fragments with those already in the framebuffer.
53 class Loader: public DataFile::ObjectLoader<Blend>
59 void constant(float, float, float, float);
60 void equation(BlendEquation);
61 void factors(BlendFactor, BlendFactor);
65 BlendEquation equation = ADD;
66 BlendFactor src_factor = ONE;
67 BlendFactor dst_factor = ZERO;
68 Color constant = { 0.0f, 0.0f, 0.0f, 0.0f };
69 ColorWriteMask write_mask = WRITE_ALL;
72 Blend(BlendFactor, BlendFactor);
73 Blend(BlendEquation, BlendFactor, BlendFactor);
77 inline ColorWriteMask operator|(ColorWriteMask m1, ColorWriteMask m2)
78 { return static_cast<ColorWriteMask>(static_cast<int>(m1)|static_cast<int>(m2)); }
80 void operator>>(const LexicalConverter &, BlendEquation &);
81 void operator<<(LexicalConverter &, BlendEquation);
83 void operator>>(const LexicalConverter &, BlendFactor &);
84 void operator<<(LexicalConverter &, BlendFactor);
86 void operator>>(const LexicalConverter &, ColorWriteMask &);
87 void operator<<(LexicalConverter &, ColorWriteMask);
92 #include "blend_backend.h"