summaryrefslogtreecommitdiff
path: root/src/texture.rs
diff options
context:
space:
mode:
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);