X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fstenciltest.h;h=2a4338f2012afef716c7f2b91494e32d7abeb7cd;hb=fcc065736e303088ef121c554318e0cc028a0666;hp=e33882dfc566570c38da5b4e3dbb4c581a10d92c;hpb=24b24e2203c776aacd9744bb947f5cf47b03d328;p=libs%2Fgl.git diff --git a/source/core/stenciltest.h b/source/core/stenciltest.h index e33882df..2a4338f2 100644 --- a/source/core/stenciltest.h +++ b/source/core/stenciltest.h @@ -8,13 +8,13 @@ namespace Msp { namespace GL { -enum StencilOp +enum StencilOp: std::uint8_t { KEEP, SET_ZERO, REPLACE, - INCR, - DECR, + INCR_CLAMP, + DECR_CLAMP, INVERT, INCR_WRAP, DECR_WRAP @@ -37,17 +37,22 @@ struct StencilTest void actions(StencilOp, StencilOp, StencilOp); }; - bool enabled; - Predicate compare; - StencilOp stencil_fail_op; - StencilOp depth_fail_op; - StencilOp depth_pass_op; - unsigned reference; + bool enabled = false; + Predicate compare = ALWAYS; + StencilOp stencil_fail_op = KEEP; + StencilOp depth_fail_op = KEEP; + StencilOp depth_pass_op = KEEP; + unsigned reference = 0; - StencilTest(); + bool operator==(const StencilTest &) const; + bool operator!=(const StencilTest &s) const { return !operator==(s); } }; -unsigned get_gl_stencil_op(StencilOp); +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); @@ -55,4 +60,6 @@ void operator<<(LexicalConverter &, StencilOp); } // namespace GL } // namespace Msp +#include "stenciltest_backend.h" + #endif