Skip to content

Simplify draw state #996

@bvssvni

Description

@bvssvni

Instead of converting from one draw state API to another, an idea is to use a simplified draw state that cover the use cases we have today.

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

impl Default for DrawState {
    fn default() -> Self {
        DrawState {
            blend: Blend::Alpha,
            stencil: None,
            scissor: None,
        }
    }
}

pub enum Blend {
    Alpha,
    Add,
    Multiply,
    Invert,
}

pub enum Stencil {
    Clip(u8),
    Inside(u8),
    Outside(u8),
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions