Struct tetra::graphics::StencilState
source · pub struct StencilState {
pub enabled: bool,
pub action: StencilAction,
pub test: StencilTest,
pub reference_value: u8,
pub write_mask: u8,
pub read_mask: u8,
}
Expand description
Represents a global stencil configuration.
Fields§
§enabled: bool
Whether stencil testing is enabled.
When set to true
, pixels drawn will be hidden
or visible depending on the stencil test and the
contents of the stencil buffer.
action: StencilAction
How drawing operations will affect the stencil buffer.
test: StencilTest
How drawn pixels will be compared to the contents of the stencil buffer to determine if they’re visible.
reference_value: u8
The value used for most StencilTest
s and
StencilAction::Replace
.
write_mask: u8
A bitmask that will be ANDed with stencil values before they’re written to the buffer.
read_mask: u8
A bitmask that will be ANDed with both the reference value and the stencil value before a stencil test occurs.
Implementations§
source§impl StencilState
impl StencilState
sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Creates a stencil configuration that will disable use of the stencil buffer.
sourcepub fn write(action: StencilAction, reference_value: u8) -> Self
pub fn write(action: StencilAction, reference_value: u8) -> Self
Creates a stencil configuration that will write pixels to the stencil buffer.
sourcepub fn read(test: StencilTest, reference_value: u8) -> Self
pub fn read(test: StencilTest, reference_value: u8) -> Self
Creates a stencil configuration that will compare drawn pixels to the contents of the stencil buffer to determine which pixels are visible.
Trait Implementations§
source§impl Clone for StencilState
impl Clone for StencilState
source§fn clone(&self) -> StencilState
fn clone(&self) -> StencilState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StencilState
impl Debug for StencilState
source§impl PartialEq<StencilState> for StencilState
impl PartialEq<StencilState> for StencilState
source§fn eq(&self, other: &StencilState) -> bool
fn eq(&self, other: &StencilState) -> bool
self
and other
values to be equal, and is used
by ==
.