diff options
Diffstat (limited to 'engine/src')
| -rw-r--r-- | engine/src/renderer.rs | 3 | ||||
| -rw-r--r-- | engine/src/renderer/opengl.rs | 10 |
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, + ); + } } } } |
