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: 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.
Methods
impl DrawState[src]
impl DrawStatepub fn new_alpha() -> DrawState[src]
pub fn new_alpha() -> DrawStateUses alpha blending.
pub fn new_clip() -> DrawState[src]
pub fn new_clip() -> DrawStateDraws to stencil buffer with value 255. This can be used for clipping.
pub fn new_inside() -> DrawState[src]
pub fn new_inside() -> DrawStateTests against stencil buffer with value 255. Draws inside the shape defined by stencil buffer.
pub fn new_outside() -> DrawState[src]
pub fn new_outside() -> DrawStateTests against stencil buffer with value 255. Draws outside the shape defined by stencil buffer.
pub fn blend(self, blend: Blend) -> DrawState[src]
pub fn blend(self, blend: Blend) -> DrawStateSets blending.
pub fn scissor(self, scissor: [u32; 4]) -> DrawState[src]
pub fn scissor(self, scissor: [u32; 4]) -> DrawStateSets scissor [x, y, w, h].
Trait Implementations
impl Copy for DrawState[src]
impl Copy for DrawStateimpl Clone for DrawState[src]
impl Clone for DrawStatefn clone(&self) -> DrawState[src]
fn clone(&self) -> DrawStateReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for DrawState[src]
impl PartialEq for DrawStatefn eq(&self, other: &DrawState) -> bool[src]
fn eq(&self, other: &DrawState) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &DrawState) -> bool[src]
fn ne(&self, other: &DrawState) -> boolThis method tests for !=.
impl Debug for DrawState[src]
impl Debug for DrawStatefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialOrd for DrawState[src]
impl PartialOrd for DrawStatefn partial_cmp(&self, other: &DrawState) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &DrawState) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &DrawState) -> bool[src]
fn lt(&self, other: &DrawState) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &DrawState) -> bool[src]
fn le(&self, other: &DrawState) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &DrawState) -> bool[src]
fn gt(&self, other: &DrawState) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &DrawState) -> bool[src]
fn ge(&self, other: &DrawState) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Default for DrawState[src]
impl Default for DrawState