Fix an OpenGL error when an sRGB image is created with mipmaps in OpenGL ES 2.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-09 21:46:56 -04:00
parent d229fb1129
commit 36e99b4880
+7
View File
@@ -310,6 +310,13 @@ bool Image::loadVolatile()
{
if (flags.sRGB && !hasSRGBSupport())
throw love::Exception("sRGB images are not supported on this system.");
// GL_EXT_sRGB doesn't support glGenerateMipmap for sRGB textures.
if (flags.sRGB && (GLAD_ES_VERSION_2_0 && GLAD_EXT_sRGB && !GLAD_ES_VERSION_3_0))
{
flags.mipmaps = false;
filter.mipmap = FILTER_NONE;
}
}
// NPOT textures don't support mipmapping without full NPOT support.