summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opengl-bindings/Cargo.toml1
-rw-r--r--opengl-bindings/src/texture.rs24
2 files changed, 25 insertions, 0 deletions
diff --git a/opengl-bindings/Cargo.toml b/opengl-bindings/Cargo.toml
index f2f57a7..f9965e6 100644
--- a/opengl-bindings/Cargo.toml
+++ b/opengl-bindings/Cargo.toml
@@ -36,6 +36,7 @@ gl_commands = [
"DeleteTextures",
"GenerateTextureMipmap",
"TextureParameteri",
+ "TextureParameterfv",
"CreateTextures",
"BindTextureUnit",
"DeleteShader",
diff --git a/opengl-bindings/src/texture.rs b/opengl-bindings/src/texture.rs
index ae5b2c3..ebfc8f4 100644
--- a/opengl-bindings/src/texture.rs
+++ b/opengl-bindings/src/texture.rs
@@ -254,6 +254,30 @@ impl Texture
}
}
+ /// Sets four floating-point values that define the border values that should be used
+ /// for border texels. If a texel is sampled from the border of the texture, these
+ /// values are interpreted as an RGBA color to match the texture's internal format
+ /// and substituted for the non-existent texel data. If the texture contains depth
+ /// components, the first value is interpreted as a depth value.
+ ///
+ /// The values are stored unmodified as floating-point values.
+ ///
+ /// The initial values are (0.0, 0.0, 0.0, 0.0).
+ pub fn set_float_border_values(
+ &self,
+ current_context: &MaybeCurrentContextWithFns,
+ values: [f32; 4],
+ )
+ {
+ unsafe {
+ current_context.fns().TextureParameterfv(
+ self.texture,
+ crate::sys::TEXTURE_BORDER_COLOR,
+ values.as_ptr(),
+ );
+ }
+ }
+
pub fn delete(self, current_context: &MaybeCurrentContextWithFns)
{
unsafe {