src/render/opengl/SDL_render_gl.c
changeset 5484 e20c93bc9122
parent 5465 46bd121b04a2
child 5503 be88d105e91c
--- a/src/render/opengl/SDL_render_gl.c	Sun Mar 13 11:17:11 2011 -0700
+++ b/src/render/opengl/SDL_render_gl.c	Sun Mar 13 11:18:35 2011 -0700
@@ -393,6 +393,18 @@
     return SDL_TRUE;
 }
 
+static GLenum
+GetScaleQuality(void)
+{
+    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
+
+    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
+        return GL_NEAREST;
+    } else {
+        return GL_LINEAR;
+    }
+}
+
 static int
 GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
 {
@@ -455,7 +467,7 @@
 
     data->format = format;
     data->formattype = type;
-    data->scaleMode = GL_LINEAR;
+    data->scaleMode = GetScaleQuality();
     renderdata->glEnable(data->type);
     renderdata->glBindTexture(data->type, data->texture);
     renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,