From e2c8e0734427a034c9f972497f92847e0c653189 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 2 May 2016 16:12:14 +0200 Subject: [PATCH] Enabled mipmapping for bitmap fonts. --- common/gal/opengl/opengl_gal.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index bf28e03e19..c2fb36cbe9 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -229,10 +229,11 @@ void OPENGL_GAL::BeginDrawing() glActiveTexture( GL_TEXTURE0 + FONT_TEXTURE_UNIT ); glGenTextures( 1, &fontTexture ); glBindTexture( GL_TEXTURE_2D, fontTexture ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RED, bitmap_font.width, bitmap_font.height, - 0, GL_RED, GL_UNSIGNED_BYTE, bitmap_font.pixels ); + 0, GL_RED, GL_UNSIGNED_BYTE, bitmap_font.pixels ); + glGenerateMipmap( GL_TEXTURE_2D ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); checkGlError( "loading bitmap font" ); glActiveTexture( GL_TEXTURE0 );