summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-08-18 21:22:20 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-08-18 21:22:20 -0400
commit8746330a4368203e4e4da8fbf447537105bbd09d (patch)
treec4dcb2b79f36be7fbe2343bfc823b9f848b3534c /2d
parent3c4d1d23a9458777f05c52fc1dae92f6467ac466 (diff)
Use GL_NEAREST method for texture scaling.
Diffstat (limited to '2d')
-rw-r--r--2d/texture.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/2d/texture.scm b/2d/texture.scm
index 6d04770..b7808b3 100644
--- a/2d/texture.scm
+++ b/2d/texture.scm
@@ -108,12 +108,14 @@
(let ((texture-id (gl-generate-texture))
(pixels (freeimage-get-bits bitmap)))
(with-gl-bind-texture (texture-target texture-2d) texture-id
+ ;; Use "nearest" scaling method so that pixel art doesn't become
+ ;; blurry when scaled.
(gl-texture-parameter (texture-target texture-2d)
(texture-parameter-name texture-min-filter)
- (texture-min-filter linear))
+ (texture-min-filter nearest))
(gl-texture-parameter (texture-target texture-2d)
(texture-parameter-name texture-mag-filter)
- (texture-mag-filter linear))
+ (texture-mag-filter nearest))
(gl-texture-image-2d (texture-target texture-2d)
0
(pixel-format rgba)