From 54e87fc0162cee761e09aacb3707413e3fe6fc0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 17 Feb 2015 15:51:05 -0500 Subject: [PATCH] lib/glesv2: fix misplaced mipmap filters and update style MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/glesv2/glesv2.nit | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/lib/glesv2/glesv2.nit b/lib/glesv2/glesv2.nit index 4e71e1f..33bb7e9 100644 --- a/lib/glesv2/glesv2.nit +++ b/lib/glesv2/glesv2.nit @@ -375,29 +375,17 @@ do end end -# Texture minifying function -# -# Used by: `GLES::tex_parameter_min_filter` -extern class GLTextureMinFilter +# Texture minifying and magnifying function +extern class GLTextureFilter super GLEnum - - new nearest `{ return GL_NEAREST; `} - new linear `{ return GL_LINEAR; `} end -# Texture magnification function -# -# Used by: `GLES::tex_parameter_mag_filter` -extern class GLTextureMagFilter - super GLEnum - - new nearest `{ return GL_NEAREST; `} - new linear `{ return GL_LINEAR; `} - new nearest_mipmap_nearest `{ return GL_NEAREST_MIPMAP_NEAREST; `} - new linear_mipmap_nearest `{ return GL_LINEAR_MIPMAP_NEAREST; `} - new nearest_mipmap_linear `{ return GL_NEAREST_MIPMAP_LINEAR; `} - new linear_mipmap_linear `{ return GL_LINEAR_MIPMAP_LINEAR; `} -end +fun gl_NEAREST: GLTextureFilter `{ return GL_NEAREST; `} +fun gl_LINEAR: GLTextureFilter `{ return GL_LINEAR; `} +fun gl_NEAREST_MIPMAP_NEAREST: GLTextureFilter `{ return GL_NEAREST_MIPMAP_NEAREST; `} +fun gl_LINEAR_MIPMAP_NEAREST: GLTextureFilter `{ return GL_LINEAR_MIPMAP_NEAREST; `} +fun gl_NEAREST_MIPMAP_NINEAR: GLTextureFilter `{ return GL_NEAREST_MIPMAP_LINEAR; `} +fun gl_LINEAR_MIPMAP_LINEAR: GLTextureFilter `{ return GL_LINEAR_MIPMAP_LINEAR; `} # Wrap parameter of a texture # @@ -550,14 +538,14 @@ class GLES # Set the texture minifying function # # Foreign: glTexParameter with GL_TEXTURE_MIN_FILTER - fun tex_parameter_min_filter(target: GLTextureTarget, value: GLTextureMinFilter) `{ + fun tex_parameter_min_filter(target: GLTextureTarget, value: GLTextureFilter) `{ glTexParameteri(target, GL_TEXTURE_MIN_FILTER, value); `} # Set the texture magnification function # # Foreign: glTexParameter with GL_TEXTURE_MAG_FILTER - fun tex_parameter_mag_filter(target: GLTextureTarget, value: GLTextureMagFilter) `{ + fun tex_parameter_mag_filter(target: GLTextureTarget, value: GLTextureFilter) `{ glTexParameteri(target, GL_TEXTURE_MAG_FILTER, value); `} -- 1.7.9.5