GlsMap Toolkit
1.4.1
|
#include <dnc_util.h>
Public Member Functions | |
FontRenderer (GlsFontBase *font, const bool forceUpload) | |
~FontRenderer () | |
GlsFontBase * | GetFont (void) |
void | InitRendering (void) |
void | TermRendering (void) |
void | RenderProportionalChar (const GlsFontBase::Char_t c, const float pen_position_x, const float pen_position_y, const float char_size_ratio_x, const float char_size_ratio_y, const GLfloat scale, const glsColor &fgColor) |
Protected Attributes | |
GlsFontRenderer * | _fontRenderer |
GlsFontBase * | _font |
font renderer helper class for rendering text features
DNCUtil::FontRenderer::FontRenderer | ( | GlsFontBase * | font, |
const bool | forceUpload | ||
) |
Ctor
font | font to render else NULL for default font |
forceUpload | true to force the font texture to be uploaded to GL (if it is not already uploaded) |
DNCUtil::FontRenderer::~FontRenderer | ( | ) |
Dtor
|
inline |
Get the font attached to the renderer
void DNCUtil::FontRenderer::InitRendering | ( | void | ) |
Initializes the font to begin rendering characters. This will set up Open GL texture modes, bind the font's texture, set up minification and magnification filters, etc. This must be called before using any of the Render methods draw characters.
void DNCUtil::FontRenderer::RenderProportionalChar | ( | const GlsFontBase::Char_t | c, |
const float | pen_position_x, | ||
const float | pen_position_y, | ||
const float | char_size_ratio_x, | ||
const float | char_size_ratio_y, | ||
const GLfloat | scale, | ||
const glsColor & | fgColor | ||
) |
Render a single proportional character NOTE: assumes that a glBegin( GL_QUADS ) has been called
c | character to render |
pen_position_x | x position of lower left of character |
pen_position_y | y position of lower left of character |
char_size_ratio_x | x size ratio |
char_size_ratio_y | y size ration |
scale | character scale |
fgColor | color for character |
void DNCUtil::FontRenderer::TermRendering | ( | void | ) |
Restores the Open GL state as it was before the call to InitRendering. This should be called after all characters have been rendered using the Render methods.
|
protected |
font being rendered
|
protected |
gls font renderer