Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
|
#include <FontRenderer.h>
Public Member Functions | |
void | loadFont (const std::string &fontPath, const std::string &fontName, int pixelHeight) |
void | createText (const std::string &text, const std::string &fontName, Scene *scene, Text *textObj) |
void | render (Shader *shader) |
Backend for font rendering. Loads true type fonts from a file.
void FontRenderer::loadFont | ( | const std::string & | fontPath, |
const std::string & | fontName, | ||
int | pixelHeight | ||
) |
Loads a true type font from fontPath
. The font is associated with fontName
. The resulting font can only be used with the specified size and should not be scaled. If different font sizes are required, this method should be called once per size. Uses the library FreeType to create bitmaps for each character in the set and packs them tightly into one GL texture by using the algorithm outlines on this website.
fontPath | path of the true type font file, relative to the folder fonts/ |
fontName | name that will be associated with this font and size |
pixelHeight | height of 'W' in pixels |
void FontRenderer::render | ( | Shader * | shader) |
Test method to render a character map onscreen.