diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-07 00:22:57 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-07 00:22:57 +0200 |
| commit | 5cb923fe13818192ad75d8b62899671d72cacb18 (patch) | |
| tree | b300b4d0dbcaa47515155cc2b7325956e3027c90 /opengl-bindings/src | |
| parent | 604ab28401f4238d0b905479877f64d0d386730f (diff) | |
feat(opengl-bindings): add fn to set face culling mode
Diffstat (limited to 'opengl-bindings/src')
| -rw-r--r-- | opengl-bindings/src/misc.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/opengl-bindings/src/misc.rs b/opengl-bindings/src/misc.rs index a0d36e3..60fc510 100644 --- a/opengl-bindings/src/misc.rs +++ b/opengl-bindings/src/misc.rs @@ -101,6 +101,14 @@ pub fn set_polygon_mode( } } +pub fn set_face_culling_mode( + current_context: &MaybeCurrentContextWithFns, + face_culling_mode: FaceCullingMode, +) +{ + unsafe { current_context.fns().CullFace(face_culling_mode as u32) } +} + pub fn enable(current_context: &MaybeCurrentContextWithFns, capacity: Capability) { unsafe { @@ -220,6 +228,18 @@ pub enum PolygonModeFace FrontAndBack = crate::sys::FRONT_AND_BACK, } +#[derive(Debug, Default)] +#[repr(u32)] +pub enum FaceCullingMode +{ + Front = crate::sys::FRONT, + + #[default] + Back = crate::sys::BACK, + + FrontAndBack = crate::sys::FRONT_AND_BACK, +} + bitflags! { #[derive(Debug, Clone, Copy)] pub struct ContextFlags: u32 { |
