Browse Source

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.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
08d9f65b06
  1. 11
      src/Text/Font.cpp

11
src/Text/Font.cpp

@ -19,6 +19,7 @@
#include FT_FREETYPE_H
#include <hb-ft.h>
#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);

Loading…
Cancel
Save