From e316d956945fc539c4162b373012afc8de74d96d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 11 Mar 2015 11:10:09 -0400 Subject: [PATCH] lib/mnit: fix and improve magnification for a pixelized (to smooth) look MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The new OpenGL paramenter act of the display of images: * When zoomed out, the image is smoother, the color values are interpolated from the neares source pixels. * When zoomed in, the image is displayed pixelized. Signed-off-by: Alexis Laferrière --- lib/mnit/opengles1.nit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mnit/opengles1.nit b/lib/mnit/opengles1.nit index 24a904b..b11d8dd 100644 --- a/lib/mnit/opengles1.nit +++ b/lib/mnit/opengles1.nit @@ -123,7 +123,8 @@ in "C" `{ PRINT_ERROR("error loading image after glTexImage2D: %i", mnit_opengles_error_code); } - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); if ((mnit_opengles_error_code = glGetError()) != GL_NO_ERROR) { PRINT_ERROR("error loading image after gtTexParameter: %i", mnit_opengles_error_code); -- 1.7.9.5