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
sourceimpl 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
sourceimpl Clone for StencilState
impl Clone for StencilState
sourcefn clone(&self) -> StencilState
fn clone(&self) -> StencilState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StencilState
impl Debug for StencilState
sourceimpl PartialEq<StencilState> for StencilState
impl PartialEq<StencilState> for StencilState
sourcefn eq(&self, other: &StencilState) -> bool
fn eq(&self, other: &StencilState) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StencilState) -> bool
fn ne(&self, other: &StencilState) -> bool
This method tests for !=
.
impl Copy for StencilState
impl Eq for StencilState
impl StructuralEq for StencilState
impl StructuralPartialEq for StencilState
Auto Trait Implementations
impl RefUnwindSafe for StencilState
impl Send for StencilState
impl Sync for StencilState
impl Unpin for StencilState
impl UnwindSafe for StencilState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more