summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-04-19 18:28:40 +0200
committerHampusM <hampus@hampusmat.com>2026-04-19 18:28:40 +0200
commit108c4ba52ad24ac4e370f1a303a68325fbd3f53e (patch)
tree6fcaacf581c4ddbab4f3a46193db8234e4c53da8
parent6171fb6c9157593906bbc0fe5145405f10131123 (diff)
feat(engine): add face culling on/off to renderer draw properties
-rw-r--r--engine/src/renderer.rs3
-rw-r--r--engine/src/renderer/opengl.rs10
2 files changed, 13 insertions, 0 deletions
diff --git a/engine/src/renderer.rs b/engine/src/renderer.rs
index b52e6b9..68e8aed 100644
--- a/engine/src/renderer.rs
+++ b/engine/src/renderer.rs
@@ -279,6 +279,7 @@ pub struct DrawProperties
pub depth_test_enabled: bool,
pub scissor_test_enabled: bool,
pub scissor_box: ScissorBox,
+ pub face_culling_enabled: bool,
}
impl Default for DrawProperties
@@ -292,6 +293,7 @@ impl Default for DrawProperties
depth_test_enabled: true,
scissor_test_enabled: false,
scissor_box: ScissorBox::default(),
+ face_culling_enabled: false,
}
}
}
@@ -306,6 +308,7 @@ bitflags! {
const DEPTH_TEST_ENABLED = 1 << 3;
const SCISSOR_TEST_ENABLED = 1 << 4;
const SCISSOR_BOX = 1 << 5;
+ const FACE_CULLING_ENABLED = 1 << 6;
}
}
diff --git a/engine/src/renderer/opengl.rs b/engine/src/renderer/opengl.rs
index 81cbdc2..a713d41 100644
--- a/engine/src/renderer/opengl.rs
+++ b/engine/src/renderer/opengl.rs
@@ -1245,6 +1245,16 @@ fn handle_commands(
.into(),
);
}
+
+ if draw_props_update_flags
+ .contains(DrawPropertiesUpdateFlags::FACE_CULLING_ENABLED)
+ {
+ set_enabled(
+ curr_gl_ctx,
+ Capability::CullFace,
+ draw_props.face_culling_enabled,
+ );
+ }
}
}
}