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§
source§impl 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.
For nested clipping, clear the stencil buffer and use DrawState::new_increment
.
sourcepub fn new_increment() -> DrawState
pub fn new_increment() -> DrawState
Increases stencil buffer. This can be used for nested 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§
source§impl PartialOrd for DrawState
impl PartialOrd for DrawState
impl Copy for DrawState
impl StructuralPartialEq for DrawState
Auto Trait Implementations§
impl Freeze for DrawState
impl RefUnwindSafe for DrawState
impl Send for DrawState
impl Sync for DrawState
impl Unpin for DrawState
impl UnwindSafe for DrawState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)