summaryrefslogtreecommitdiff
path: root/engine/src/draw_flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/draw_flags.rs')
-rw-r--r--engine/src/draw_flags.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/engine/src/draw_flags.rs b/engine/src/draw_flags.rs
new file mode 100644
index 0000000..c8c11c9
--- /dev/null
+++ b/engine/src/draw_flags.rs
@@ -0,0 +1,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,
+}