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 | |
| parent | 604ab28401f4238d0b905479877f64d0d386730f (diff) | |
feat(opengl-bindings): add fn to set face culling mode
| -rw-r--r-- | opengl-bindings/Cargo.toml | 1 | ||||
| -rw-r--r-- | opengl-bindings/src/misc.rs | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/opengl-bindings/Cargo.toml b/opengl-bindings/Cargo.toml index ca8a400..f2f57a7 100644 --- a/opengl-bindings/Cargo.toml +++ b/opengl-bindings/Cargo.toml @@ -78,4 +78,5 @@ gl_commands = [ "BindFramebuffer", "NamedFramebufferDrawBuffer", "NamedFramebufferReadBuffer", + "CullFace" ] 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 { |
