From faa6b43441b012822a0cb8df84c309e88b509405 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 3 Jul 2015 13:01:22 -0300 Subject: [PATCH] Hopefully fixed a font initialization failure when OpenGL ES 3 is used. --- src/modules/graphics/opengl/Font.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/opengl/Font.cpp b/src/modules/graphics/opengl/Font.cpp index 5f6c8f2c2..2589ddd8e 100644 --- a/src/modules/graphics/opengl/Font.cpp +++ b/src/modules/graphics/opengl/Font.cpp @@ -148,8 +148,10 @@ void Font::createTexture() GLenum internalformat = type == FONT_TRUETYPE ? GL_LUMINANCE8_ALPHA8 : GL_RGBA8; - // in GLES2, the internalformat and format params of TexImage have to match. - if (GLAD_ES_VERSION_2_0 && !GLAD_ES_VERSION_3_0) + // In GLES2, the internalformat and format params of TexImage have to match. + // There is still no GL_LUMINANCE8_ALPHA8 in GLES3, so we have to use + // GL_LUMINANCE_ALPHA even on ES3. + if (GLAD_ES_VERSION_2_0) internalformat = format; // Initialize the texture with transparent black.