summaryrefslogtreecommitdiff
path: root/opengl-bindings/src
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings/src')
-rw-r--r--opengl-bindings/src/texture.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/opengl-bindings/src/texture.rs b/opengl-bindings/src/texture.rs
index 9ed7926..4bf8ac6 100644
--- a/opengl-bindings/src/texture.rs
+++ b/opengl-bindings/src/texture.rs
@@ -421,6 +421,14 @@ pub enum SrgbaDataType
UnsignedByte = crate::sys::UNSIGNED_BYTE,
}
+#[derive(Debug, Clone, Copy)]
+#[non_exhaustive]
+#[repr(u32)]
+pub enum DepthComponentDataType
+{
+ Float32 = crate::sys::FLOAT,
+}
+
/// Texture pixel data format.
#[derive(Debug, Clone, Copy)]
#[non_exhaustive]
@@ -430,6 +438,7 @@ pub enum PixelDataFormat
Rgba(RgbaDataType),
Srgb(SrgbDataType),
Srgba(SrgbaDataType),
+ DepthComponent(DepthComponentDataType),
}
impl PixelDataFormat
@@ -441,6 +450,9 @@ impl PixelDataFormat
Self::Rgba(RgbaDataType::UnsignedByte) => crate::sys::RGBA8,
Self::Srgb(SrgbDataType::UnsignedByte) => crate::sys::SRGB8,
Self::Srgba(SrgbaDataType::UnsignedByte) => crate::sys::SRGB8_ALPHA8,
+ Self::DepthComponent(DepthComponentDataType::Float32) => {
+ crate::sys::DEPTH_COMPONENT32F
+ }
}
}
@@ -449,6 +461,7 @@ impl PixelDataFormat
match self {
Self::Rgb(_) | Self::Srgb(_) => crate::sys::RGB,
Self::Rgba(_) | Self::Srgba(_) => crate::sys::RGBA,
+ Self::DepthComponent(_) => crate::sys::DEPTH_COMPONENT,
}
}
@@ -459,6 +472,7 @@ impl PixelDataFormat
Self::Srgb(ty) => ty as crate::sys::types::GLenum,
Self::Rgba(ty) => ty as crate::sys::types::GLenum,
Self::Srgba(ty) => ty as crate::sys::types::GLenum,
+ Self::DepthComponent(ty) => ty as crate::sys::types::GLenum,
}
}
@@ -467,6 +481,7 @@ impl PixelDataFormat
match self {
Self::Rgb(_) | Self::Srgb(_) => 3,
Self::Rgba(_) | Self::Srgba(_) => 4,
+ Self::DepthComponent(_) => 1,
}
}
}