diff options
author | HampusM <hampus@hampusmat.com> | 2024-11-24 21:04:30 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-11-24 21:04:30 +0100 |
commit | 09b9f3c1cbd93c75b2fe69257b278ad3f993adf4 (patch) | |
tree | 8de3ad13c46ec6856e81dc75c047facc11c747c2 /engine/src/opengl/mod.rs | |
parent | b233ff766a2e399a0a48a98e1f2121e960254950 (diff) |
refactor(engine): remove 'debug' crate feature flag
Diffstat (limited to 'engine/src/opengl/mod.rs')
-rw-r--r-- | engine/src/opengl/mod.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/engine/src/opengl/mod.rs b/engine/src/opengl/mod.rs index a4d3959..53e0120 100644 --- a/engine/src/opengl/mod.rs +++ b/engine/src/opengl/mod.rs @@ -1,4 +1,5 @@ use bitflags::bitflags; +use gl::types::GLint; use crate::data_types::dimens::Dimens; use crate::vector::Vec2; @@ -11,7 +12,6 @@ pub mod vertex_array; mod util; -#[cfg(feature = "debug")] pub mod debug; pub fn set_viewport(position: Vec2<u32>, size: Dimens<u32>) @@ -48,6 +48,17 @@ pub fn enable(capacity: Capability) } } +pub fn get_context_flags() -> ContextFlags +{ + let mut context_flags: GLint = 0; + + unsafe { + gl::GetIntegerv(gl::CONTEXT_FLAGS as u32, &mut context_flags); + } + + ContextFlags::from_bits_truncate(context_flags as u32) +} + bitflags! { #[derive(Debug, Clone, Copy)] pub struct BufferClearMask: u32 { @@ -106,3 +117,12 @@ impl From<crate::draw_flags::PolygonModeFace> for PolygonModeFace } } } + +bitflags! { +#[derive(Debug, Clone, Copy)] +pub struct ContextFlags: u32 { + const FORWARD_COMPATIBLE = gl::CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; + const DEBUG = gl::CONTEXT_FLAG_DEBUG_BIT; + const ROBUST_ACCESS = gl::CONTEXT_FLAG_ROBUST_ACCESS_BIT; +} +} |