From 08d9f65b0659d4958b4395c29979bd0841eeb79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 12 Jan 2013 16:38:11 +0100 Subject: [PATCH] Text: assert that {ARB,EXT}_texture_rg is supported. EXT_texture_rg is not available on my OpenGL ES 2.0 implementation, will find alternative later. At least it now compiles. --- src/Text/Font.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Text/Font.cpp b/src/Text/Font.cpp index 757a070ad..c294641ee 100644 --- a/src/Text/Font.cpp +++ b/src/Text/Font.cpp @@ -19,6 +19,7 @@ #include FT_FREETYPE_H #include +#include "Extensions.h" #include "Image.h" #include "TextureTools/Atlas.h" @@ -86,10 +87,20 @@ Font::Font(FontRenderer& renderer, const std::string& fontFile, GLfloat size, co } /* Set texture data */ + #ifndef MAGNUM_TARGET_GLES _texture.setImage(0, Texture2D::InternalFormat::R8, &image); + #else + _texture.setImage(0, Texture2D::InternalFormat::Red, &image); + #endif } void Font::create(FontRenderer& renderer, const std::string& fontFile) { + #ifndef MAGNUM_TARGET_GLES + MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::texture_rg); + #else + MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::EXT::texture_rg); + #endif + /* Create FreeType font */ CORRADE_INTERNAL_ASSERT(FT_New_Face(renderer.library(), fontFile.c_str(), 0, &_ftFont) == 0); CORRADE_INTERNAL_ASSERT(FT_Set_Char_Size(_ftFont, 0, _size*64, 100, 100) == 0);