namespace Msp {
namespace GL {
-enum BlendEquation
+enum BlendEquation: std::uint8_t
{
ADD,
SUBTRACT,
MAX
};
-enum BlendFactor
+enum BlendFactor: std::uint8_t
{
ZERO,
ONE,
ONE_MINUS_CONSTANT_ALPHA
};
-enum ColorWriteMask
+enum ColorWriteMask: std::uint8_t
{
WRITE_NONE = 0,
WRITE_RED = 1,
Blend() = default;
Blend(BlendFactor, BlendFactor);
Blend(BlendEquation, BlendFactor, BlendFactor);
+
+ bool operator==(const Blend &) const;
+ bool operator!=(const Blend &b) const { return !operator==(b); }
};
+inline bool Blend::operator==(const Blend &other) const
+{
+ return enabled==other.enabled && equation==other.equation && src_factor==other.src_factor &&
+ dst_factor==other.dst_factor && constant==other.constant && write_mask==other.write_mask;
+}
+
inline ColorWriteMask operator|(ColorWriteMask m1, ColorWriteMask m2)
{ return static_cast<ColorWriteMask>(static_cast<int>(m1)|static_cast<int>(m2)); }