FlatInput had broken mipmap generation. Fixed.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 10:58:12 +0000 (12:58 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Oct 2012 10:58:12 +0000 (12:58 +0200)
flat_input.cpp

index 0516083..6481bc2 100644 (file)
@@ -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();