X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fstenciltest.h;h=2a4338f2012afef716c7f2b91494e32d7abeb7cd;hp=c6a385d37f7e7efabbcc158cffc19c5c51eee2d4;hb=HEAD;hpb=0d89e19481d4d5f770411141906f9df344c6b823 diff --git a/source/core/stenciltest.h b/source/core/stenciltest.h index c6a385d3..2a4338f2 100644 --- a/source/core/stenciltest.h +++ b/source/core/stenciltest.h @@ -8,7 +8,7 @@ namespace Msp { namespace GL { -enum StencilOp +enum StencilOp: std::uint8_t { KEEP, SET_ZERO, @@ -43,8 +43,17 @@ struct StencilTest StencilOp depth_fail_op = KEEP; StencilOp depth_pass_op = KEEP; unsigned reference = 0; + + bool operator==(const StencilTest &) const; + bool operator!=(const StencilTest &s) const { return !operator==(s); } }; +inline bool StencilTest::operator==(const StencilTest &other) const +{ + return enabled==other.enabled && compare==other.compare && stencil_fail_op==other.stencil_fail_op && + depth_fail_op==other.depth_fail_op && depth_pass_op==other.depth_pass_op && reference==other.reference; +} + void operator>>(const LexicalConverter &, StencilOp &); void operator<<(LexicalConverter &, StencilOp);