Struct graphics::draw_state::DrawState [] [src]

pub struct DrawState {
    pub scissor: Option<[u32; 4]>,
    pub stencil: Option<Stencil>,
    pub blend: Option<Blend>,
}

Graphics draw state used for blending, clipping and stencil rendering.

Fields

scissor

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

Stencil test to use. If None, no stencil testing is done.

blend

Blend function to use. If None, blending is disabled.

Methods

impl DrawState

fn new_alpha() -> DrawState

Uses alpha blending.

fn new_clip() -> DrawState

Draws to stencil buffer with value 255. This can be used for clipping.

fn new_inside() -> DrawState

Tests against stencil buffer with value 255. Draws inside the shape defined by stencil buffer.

fn new_outside() -> DrawState

Tests against stencil buffer with value 255. Draws outside the shape defined by stencil buffer.

fn blend(self, blend: Blend) -> DrawState

Sets blending.

fn scissor(self, scissor: [u32; 4]) -> DrawState

Sets scissor [x, y, w, h].

Trait Implementations

impl Default for DrawState

fn default() -> Self

Derived Implementations

impl PartialOrd for DrawState

fn partial_cmp(&self, __arg_0: &DrawState) -> Option<Ordering>

fn lt(&self, __arg_0: &DrawState) -> bool

fn le(&self, __arg_0: &DrawState) -> bool

fn gt(&self, __arg_0: &DrawState) -> bool

fn ge(&self, __arg_0: &DrawState) -> bool

impl Debug for DrawState

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl PartialEq for DrawState

fn eq(&self, __arg_0: &DrawState) -> bool

fn ne(&self, __arg_0: &DrawState) -> bool

impl Clone for DrawState

fn clone(&self) -> DrawState

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for DrawState