lib/mnit: fix and improve magnification for a pixelized (to smooth) look
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 11 Mar 2015 15:10:09 +0000 (11:10 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Apr 2015 19:05:31 +0000 (15:05 -0400)
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 <alexis.laf@xymus.net>

lib/mnit/opengles1.nit

index 24a904b..b11d8dd 100644 (file)
@@ -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);