+ # Set whether this texture should be pixelated when drawn, otherwise it is interpolated
+ fun pixelated=(pixelated: Bool)
+ do
+ # TODO this service could be made available in `Texture` when using
+ # the kind of texture wrapper of gles v2 or maybe 3
+
+ glBindTexture(gl_TEXTURE_2D, gl_texture)
+
+ var param = if pixelated then gl_NEAREST else gl_LINEAR
+ glTexParameteri(gl_TEXTURE_2D, gl_TEXTURE_MIN_FILTER, param)
+ glTexParameteri(gl_TEXTURE_2D, gl_TEXTURE_MAG_FILTER, param)
+ end
+