GlsMap Toolkit  1.4.1
disti::DNCUtil::FontRenderer Class Reference

#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
 

Detailed Description

font renderer helper class for rendering text features

Constructor & Destructor Documentation

DNCUtil::FontRenderer::FontRenderer ( GlsFontBase *  font,
const bool  forceUpload 
)

Ctor

Parameters
fontfont to render else NULL for default font
forceUploadtrue to force the font texture to be uploaded to GL (if it is not already uploaded)
DNCUtil::FontRenderer::~FontRenderer ( )

Dtor

Member Function Documentation

GlsFontBase* disti::DNCUtil::FontRenderer::GetFont ( void  )
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

Parameters
ccharacter to render
pen_position_xx position of lower left of character
pen_position_yy position of lower left of character
char_size_ratio_xx size ratio
char_size_ratio_yy size ration
scalecharacter scale
fgColorcolor 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.

Member Data Documentation

GlsFontBase* disti::DNCUtil::FontRenderer::_font
protected

font being rendered

GlsFontRenderer* disti::DNCUtil::FontRenderer::_fontRenderer
protected

gls font renderer


The documentation for this class was generated from the following files: