GL Studio Safety Critical Embedded C++ Runtime Library
|
#include <gls_text.h>
Classes | |
struct | LineSegment |
Public Member Functions | |
UnderlineStrikeThruRenderer (const GlsUInt32 numLineSegments, const GlsFloat32 cellWidth, const GlsFloat32 cellHeight, const GlsBool shadow, const GlsFloat32 shadowDistance, const GlsColor &shadowColor, const GlsFloat32 underlineOffset, const GlsFloat32 underlineSize) | |
void | SetShadowColor (const GlsColor &shadowColor) |
void | Reset (void) |
void | PreProcessCharacter (const GlsText::CharAttribute &charAttribute, const GlsFloat32 cellX, const GlsFloat32 charY) |
void | PostProcessCharacter (const GlsText::CharAttribute &charAttribute, const GlsFloat32 cellX, const GlsFloat32 charY, const GlsBool endOfLine) |
void | RenderLineSegments (GlsStateManager &gl) const |
GlsBool | IsUpToDate (void) const |
Protected Member Functions | |
void | DrawScalableLine (GlsStateManager &gl, const GlsFloat32 x1, const GlsFloat32 y1, const GlsFloat32 x2, const GlsFloat32 y2) const |
~UnderlineStrikeThruRenderer () | |
Helper class for processing underline and strike-thru when drawing text
GlsText::UnderlineStrikeThruRenderer::UnderlineStrikeThruRenderer | ( | const GlsUInt32 | numLineSegments, |
const GlsFloat32 | cellWidth, | ||
const GlsFloat32 | cellHeight, | ||
const GlsBool | shadow, | ||
const GlsFloat32 | shadowDistance, | ||
const GlsColor & | shadowColor, | ||
const GlsFloat32 | underlineOffset, | ||
const GlsFloat32 | underlineSize | ||
) |
Constructor - create an instance
numLineSegments | number of line segments supported by renderer (>0) |
cellWidth | width of a character cell |
cellHeight | height of a character cell |
shadow | GLS_TRUE if text has shadow enabled else GLS_FALSE |
shadowDistance | distance for shadow |
shadowColor | color of shadow |
underlineOffset | offset of underline |
underlineSize | size of underline |
|
protected |
Destructor - shall never be called
|
protected |
Draw a line by rendering a filled polygon with a line around it so that the thickness of the line can be varied and antialiasing occurs if enabled
gl | GL state manager to draw into |
x1 | x coord of first corner of the line poly |
y1 | y coord of first corner of the line poly |
x2 | x coord of opposite corner of the line poly |
y2 | y coord of opposite corner of the line poly |
GlsBool GlsText::UnderlineStrikeThruRenderer::IsUpToDate | ( | void | ) | const |
Determine if the line segments in the renderer are up to date
void GlsText::UnderlineStrikeThruRenderer::PostProcessCharacter | ( | const GlsText::CharAttribute & | charAttribute, |
const GlsFloat32 | cellX, | ||
const GlsFloat32 | charY, | ||
const GlsBool | endOfLine | ||
) |
Post Process the given character attributes
charAttribute | character attribute in question |
cellX | x coord of character cell one past the given character |
charY | y coord of character |
endOfLine | GLS_TRUE if character is the end of the current line else GLS_FALSE |
void GlsText::UnderlineStrikeThruRenderer::PreProcessCharacter | ( | const GlsText::CharAttribute & | charAttribute, |
const GlsFloat32 | cellX, | ||
const GlsFloat32 | charY | ||
) |
Pre Process the given character attribute
charAttribute | character attribute in question |
cellX | x coord of character |
charY | y coord of character |
void GlsText::UnderlineStrikeThruRenderer::RenderLineSegments | ( | GlsStateManager & | gl | ) | const |
Render the line segments for the underline / strikethru
gl | OpenGL state manager to render into |
void GlsText::UnderlineStrikeThruRenderer::Reset | ( | void | ) |
Invalidate all line segments in the renderer
void GlsText::UnderlineStrikeThruRenderer::SetShadowColor | ( | const GlsColor & | shadowColor | ) |
Set the shadow color associated with the renderer
shadowColor | new shadow color |
|
protected |
height of one character cell
|
protected |
width of one character cell
|
protected |
GLS_TRUE if _lineSegments is up to date, else GLS_FALSE if the line segments need to be recomputed
|
protected |
array of line segments to render ( _maxNumLineSegments number of elements )
|
protected |
maximum number of line segments the renderer can hold
|
protected |
current number of line segments in the _lineSegments array ( <= _maxNumLineSegments )
|
protected |
GLS_TRUE if shadowing is enabled else GLS_FALSE
|
protected |
color of shadow
|
protected |
distance of shadow line segment from primary line segment
|
protected |
color of next strikethru line segment
|
protected |
GLS_TRUE if strikethru is currently on when processing characters
|
protected |
character scaling applied to the next strikethru line segment
|
protected |
starting x coord for next strikethru line segment
|
protected |
ending x x coord for next strikethru line segment
|
protected |
y coord for next strikethru line segment
|
protected |
color of next underline line segment
|
protected |
offset of underline line segment
|
protected |
GLS_TRUE if underlining is currently on when processing characters
|
protected |
character scaling applied to the next underline line segment
|
protected |
size of underline segment
|
protected |
starting x coord for next underline line segment
|
protected |
ending x x coord for next underline line segment
|
protected |
y coord for next underline line segment