Struct piston_window::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.
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
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl 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 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<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.