UI DPI: use a sharper filter when scaling icons, when the scale matches a mipmap

level, this has no effect, it's for the zoom levels in between. There's a
tradeoff here between blurring and aliasing, I think this looks better.

Before: http://www.pasteall.org/pic/show.php?id=42090
After: http://www.pasteall.org/pic/show.php?id=42091
This commit is contained in:
Brecht Van Lommel
2012-12-19 12:51:43 +00:00
parent cdb6aad54c
commit ec85a4370f

View File

@@ -958,6 +958,9 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, icongltex.id);
/* sharper downscaling, has no effect when scale matches with a mip level */
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, -0.5f);
glBegin(GL_QUADS);
glTexCoord2f(x1, y1);
glVertex2f(x, y);
@@ -972,6 +975,8 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy
glVertex2f(x, y + h);
glEnd();
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, 0.0f);
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
}