| GlsMap Toolkit 1.10.1

Public Member Functions | Protected Attributes | List of all members
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

## ◆ FontRenderer()

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

Ctor

Parameters

  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)

## ◆ ~FontRenderer()

DNCUtil::FontRenderer::~FontRenderer | ( |  | ) |

Dtor

## Member Function Documentation

## ◆ GetFont()

GlsFontBase * disti::DNCUtil::FontRenderer::GetFont | ( | void |  | ) |
| inline

Get the font attached to the renderer

## ◆ InitRendering()

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.

## ◆ RenderProportionalChar()

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

  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

## ◆ TermRendering()

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

## ◆ _font

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

font being rendered

## ◆ _fontRenderer

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

gls font renderer

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

- dnc_util.h
- dnc_util.cpp