ombre 0.6.7

Shadowy game and graphics library for Rust
Documentation
use super::*;

#[derive(Debug, Copy, Clone, PartialEq)]
pub struct StencilState {
    /// Front-facing fragment tests.
    pub front: StencilFaceState,
    /// Back-facing fragment tests.
    pub back: StencilFaceState,
    /// Specifies the reference value for the stencil test. Default is 0.
    pub reference: i32,
    /// Specifies a mask that is `&`ed with both the reference value and the stored stencil value
    /// when the test is done. The initial value is all 1's.
    pub read_mask: u32,
    /// Specifies a bit mask to enable and disable writing of individual bits in the stencil planes.
    /// Initially, the mask is all 1's.
    pub write_mask: u32,
}

#[derive(Debug, Copy, Clone, PartialEq)]
pub struct StencilFaceState {
    /// Used to determine if the stencil test passes or fails.
    pub compare: Comparison,
    /// Operation to use when stencil test fails.
    pub fail_op: StencilOp,
    /// Operation to use when stencil test passes, but depth test fails.
    pub depth_fail_op: StencilOp,
    /// Operation to use when both stencil and depth test pass,
    /// or when stencil pass and no depth or depth is disabled.
    pub pass_op: StencilOp,
}

/// Stencil operations performed on value after comparison.
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
pub enum StencilOp {
    #[default]
    Keep,
    Zero,
    Replace,
    IncrementClamp,
    DecrementClamp,
    Invert,
    IncrementWrap,
    DecrementWrap,
}