summaryrefslogtreecommitdiff
path: root/src/texture.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-04-02 12:54:43 -0400
committerLLLL Colonq <llll@colonq>2024-04-02 12:54:43 -0400
commit17eb85df48b64dd9d391cad28f58355e05ed2855 (patch)
tree3d997324d3efc1cefc82861e058ca8badbe4dc16 /src/texture.rs
parentdd7f375f67251467e9799961428f87258df7282f (diff)
Update
Diffstat (limited to 'src/texture.rs')
-rw-r--r--src/texture.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/texture.rs b/src/texture.rs
index a7c9893..2da2247 100644
--- a/src/texture.rs
+++ b/src/texture.rs
@@ -42,6 +42,14 @@ impl Texture {
}
}
+ pub fn set_linear_filtering(&self, ctx: &context::Context) {
+ unsafe {
+ ctx.gl.bind_texture(glow::TEXTURE_2D, Some(self.tex));
+ ctx.gl.tex_parameter_i32(glow::TEXTURE_2D, glow::TEXTURE_MIN_FILTER, glow::NEAREST_MIPMAP_NEAREST as i32);
+ ctx.gl.tex_parameter_i32(glow::TEXTURE_2D, glow::TEXTURE_MAG_FILTER, glow::NEAREST_MIPMAP_NEAREST as i32);
+ }
+ }
+
pub fn bind(&self, ctx: &context::Context) {
unsafe {
ctx.gl.active_texture(glow::TEXTURE0);