From: Alexis Laferrière Date: Wed, 11 Mar 2015 15:10:09 +0000 (-0400) Subject: lib/mnit: fix and improve magnification for a pixelized (to smooth) look X-Git-Tag: v0.7.4~10^2 X-Git-Url: http://nitlanguage.org lib/mnit: fix and improve magnification for a pixelized (to smooth) look 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 --- 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);