diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-07 00:24:09 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-07 00:24:09 +0200 |
| commit | 6eefb4d3a03d8ba4f3e7f5494831d6417b8dcc12 (patch) | |
| tree | 92bb8b4ca6aa751338f2902a425c5c9401a30c31 /engine/src/rendering.rs | |
| parent | 5cb923fe13818192ad75d8b62899671d72cacb18 (diff) | |
feat(engine): add face culling mode to rendering::DrawProperties
Diffstat (limited to 'engine/src/rendering.rs')
| -rw-r--r-- | engine/src/rendering.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/engine/src/rendering.rs b/engine/src/rendering.rs index 1bb11cc..524c617 100644 --- a/engine/src/rendering.rs +++ b/engine/src/rendering.rs @@ -384,6 +384,7 @@ pub struct DrawProperties pub scissor_test_enabled: bool, pub scissor_box: ScissorBox, pub face_culling_enabled: bool, + pub face_culling_mode: FaceCullingMode, /// `None` for default framebuffer pub draw_framebuffer: Option<ObjectId>, @@ -405,6 +406,7 @@ impl Default for DrawProperties scissor_test_enabled: false, scissor_box: ScissorBox::default(), face_culling_enabled: false, + face_culling_mode: FaceCullingMode::default(), draw_framebuffer: None, read_framebuffer: None, } @@ -423,11 +425,23 @@ bitflags! { const SCISSOR_TEST_ENABLED = 1 << 5; const SCISSOR_BOX = 1 << 6; const FACE_CULLING_ENABLED = 1 << 7; - const DRAW_FRAMEBUFFER = 1 << 8; - const READ_FRAMEBUFFER = 1 << 9; + const FACE_CULLING_MODE = 1 << 8; + const DRAW_FRAMEBUFFER = 1 << 9; + const READ_FRAMEBUFFER = 1 << 10; } } +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum FaceCullingMode +{ + Front, + + #[default] + Back, + + FrontAndBack, +} + #[derive(Debug, Clone)] #[non_exhaustive] pub enum TextureCreation |
