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]
.