diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-12 12:47:11 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-12 12:47:11 +0200 |
| commit | 177abc8fed26f2c9c04622e94fa7271629c78396 (patch) | |
| tree | e35872f099533a57239384750b65e44d994e1e46 | |
| parent | de530482a01828c065801bf1bc18617108b7ae40 (diff) | |
feat(opengl-bindings): add fn to set texture border values
| -rw-r--r-- | opengl-bindings/Cargo.toml | 1 | ||||
| -rw-r--r-- | opengl-bindings/src/texture.rs | 24 |
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 { |
