From ec111247c614663d8231245a17c314b9b8b4a28c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 21 Dec 2019 22:24:15 +0800 Subject: *misc --- src/core/stencil.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/core/stencil.h (limited to 'src/core/stencil.h') diff --git a/src/core/stencil.h b/src/core/stencil.h new file mode 100644 index 0000000..8af73d0 --- /dev/null +++ b/src/core/stencil.h @@ -0,0 +1,28 @@ +#ifndef _SOFTSHADEROOM_STENCIL_H_ +#define _SOFTSHADEROOM_STENCIL_H_ + +#include "../util/type.h" + +typedef bool(*StencilFunc)(byte src, byte ref); + +bool stencil_always(byte src, byte ref); +bool stencil_never(byte src, byte ref); +bool stencil_less(byte src, byte ref); +bool stencil_equal(byte src, byte ref); +bool stencil_leuqal(byte src, byte ref); +bool stencil_greater(byte src, byte ref); +bool stencil_notequal(byte src, byte ref); +bool stencil_gequer(byte src, byte ref); + +typedef byte (*StencilOp)(byte src, byte ref); + +byte stencilop_keep(byte src, byte ref); +byte stencilop_zero(byte src, byte ref); +byte stencilop_replace(byte src, byte ref); +byte stencilop_incr(byte src, byte ref); +byte stencilop_incrwrap(byte src, byte ref); +byte stencilop_decr(byte src, byte ref); +byte stencilop_decrwrap(byte src, byte ref); +byte stencilop_invert(byte src, byte ref); + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0