From 17eb85df48b64dd9d391cad28f58355e05ed2855 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 2 Apr 2024 12:54:43 -0400 Subject: Update --- src/texture.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/texture.rs') 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); -- cgit v1.2.3