summaryrefslogtreecommitdiff
path: root/opengl-bindings/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-09-12 12:47:11 +0200
committerHampusM <hampus@hampusmat.com>2026-09-12 12:47:11 +0200
commit177abc8fed26f2c9c04622e94fa7271629c78396 (patch)
treee35872f099533a57239384750b65e44d994e1e46 /opengl-bindings/src
parentde530482a01828c065801bf1bc18617108b7ae40 (diff)
feat(opengl-bindings): add fn to set texture border values
Diffstat (limited to 'opengl-bindings/src')
-rw-r--r--opengl-bindings/src/texture.rs24
1 files changed, 24 insertions, 0 deletions
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 {