From 7c293685d872fbde282a430067d18f35b9fb7ab6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 13 Oct 2012 12:58:12 +0200 Subject: [PATCH] FlatInput had broken mipmap generation. Fixed. --- flat_input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flat_input.cpp b/flat_input.cpp index 0516083..6481bc2 100644 --- a/flat_input.cpp +++ b/flat_input.cpp @@ -71,13 +71,13 @@ void FlatInput::finalize() check_error(); glBindTexture(GL_TEXTURE_2D, texture_num); check_error(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, needs_mipmaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR); check_error(); glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch); check_error(); // Intel/Mesa seems to have a broken glGenerateMipmap() for non-FBO textures, so do it here // instead of calling glGenerateMipmap(). - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, needs_mipmaps); + glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, needs_mipmaps ? GL_TRUE : GL_FALSE); check_error(); glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, type, NULL); check_error(); -- 2.39.2