summaryrefslogtreecommitdiff
path: root/engine/src/draw_flags.rs
blob: c8c11c99f53417abcf4915286389cf29ea1e1c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use ecs::Component;

use crate::util::builder;

builder! {
/// Flags for how a object should be drawn.
#[builder(name = Builder, derives = (Debug, Default, Clone))]
#[derive(Debug, Default, Clone, Component)]
#[non_exhaustive]
pub struct DrawFlags
{
    pub polygon_mode_config: PolygonModeConfig,
}
}

impl DrawFlags
{
    pub fn builder() -> Builder
    {
        Builder::default()
    }
}

#[derive(Debug, Default, Clone)]
pub struct PolygonModeConfig
{
    pub face: PolygonModeFace,
    pub mode: PolygonMode,
}

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum PolygonMode
{
    Point,
    Line,

    #[default]
    Fill,
}

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum PolygonModeFace
{
    Front,
    Back,

    #[default]
    FrontAndBack,
}