Struct graphics::draw_state::DrawState
source · pub struct DrawState {
pub scissor: Option<[u32; 4]>,
pub stencil: Option<Stencil>,
pub blend: Option<Blend>,
}
Expand description
Graphics draw state used for blending, clipping and stencil rendering.
Fields
scissor: Option<[u32; 4]>
Scissor mask to use. If set, no pixel outside of this rectangle (in screen space) will be written to as a result of rendering.
stencil: Option<Stencil>
Stencil test to use. If None, no stencil testing is done.
blend: Option<Blend>
Blend function to use. If None, blending is disabled.
Implementations
sourceimpl DrawState
impl DrawState
sourcepub fn new_clip() -> DrawState
pub fn new_clip() -> DrawState
Draws to stencil buffer with value 255. This can be used for clipping.
sourcepub fn new_inside() -> DrawState
pub fn new_inside() -> DrawState
Tests against stencil buffer with value 255. Draws inside the shape defined by stencil buffer.
sourcepub fn new_outside() -> DrawState
pub fn new_outside() -> DrawState
Tests against stencil buffer with value 255. Draws outside the shape defined by stencil buffer.
Trait Implementations
sourceimpl PartialOrd<DrawState> for DrawState
impl PartialOrd<DrawState> for DrawState
sourcefn partial_cmp(&self, other: &DrawState) -> Option<Ordering>
fn partial_cmp(&self, other: &DrawState) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DrawState
impl StructuralPartialEq for DrawState
Auto Trait Implementations
impl RefUnwindSafe for DrawState
impl Send for DrawState
impl Sync for DrawState
impl Unpin for DrawState
impl UnwindSafe for DrawState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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