gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes
gVirtualXRay::TextRenderer Class Reference

TextRenderer is a class to render text using OpenGL and FreeType2. More...

#include <TextRenderer.h>

Collaboration diagram for gVirtualXRay::TextRenderer:
Collaboration graph

Public Member Functions

 TextRenderer ()
 Default constructor. More...
 
virtual ~TextRenderer ()
 Destructor. More...
 
void release ()
 
void initialise (unsigned int aFontSize=16 *38)
 Initialise the default font. More...
 
void initialize (unsigned int aFontSize=16 *38)
 Initialise the default font. More...
 
void initialise (const std::string aFontFile, unsigned int aFontSize=16 *38)
 Initialise the given font. More...
 
void initialize (const std::string aFontFile, unsigned int aFontSize=16 *38)
 Initialise the given font. More...
 
void renderText (const std::string &aText, float x, float y, Matrix4x4< GLfloat > &aProjectionMatrix, GLfloat *apBackgroundColour, GLfloat *apFontColour)
 Display some text. More...
 
bool isInitialised () const
 Accessor on the initialisation flag. More...
 

Protected Member Functions

void initialiseInternalStates (unsigned int aFontSize)
 Initialise internal states. More...
 

Protected Attributes

bool m_initialised
 Flag set to true when the fond is initialised. More...
 

Detailed Description

TextRenderer is a class to render text using OpenGL and FreeType2.

Definition at line 106 of file TextRenderer.h.

Constructor & Destructor Documentation

◆ TextRenderer()

gVirtualXRay::TextRenderer::TextRenderer ( )
inline

Default constructor.

Definition at line 109 of file TextRenderer.inl.

◆ ~TextRenderer()

gVirtualXRay::TextRenderer::~TextRenderer ( )
inlinevirtual

Destructor.

Definition at line 118 of file TextRenderer.inl.

Member Function Documentation

◆ initialise() [1/2]

void gVirtualXRay::TextRenderer::initialise ( unsigned int  aFontSize = 16 *38)

Initialise the default font.

Parameters
aFontSizethe font size (default value: 16*38)

◆ initialise() [2/2]

void gVirtualXRay::TextRenderer::initialise ( const std::string  aFontFile,
unsigned int  aFontSize = 16 *38 
)

Initialise the given font.

Parameters
aFontFilethe font file
aFontSizethe font size (default value: 16*38)

◆ initialiseInternalStates()

void gVirtualXRay::TextRenderer::initialiseInternalStates ( unsigned int  aFontSize)
protected

Initialise internal states.

Parameters
aFontSizethe font size

◆ initialize() [1/2]

void gVirtualXRay::TextRenderer::initialize ( unsigned int  aFontSize = 16*38)
inline

Initialise the default font.

Parameters
aFontSizethe font size (default value: 16*38)

Definition at line 140 of file TextRenderer.inl.

◆ initialize() [2/2]

void gVirtualXRay::TextRenderer::initialize ( const std::string  aFontFile,
unsigned int  aFontSize = 16*38 
)
inline

Initialise the given font.

Parameters
aFontFilethe font file
aFontSizethe font size (default value: 16*38)

Definition at line 148 of file TextRenderer.inl.

◆ isInitialised()

bool gVirtualXRay::TextRenderer::isInitialised ( ) const
inline

Accessor on the initialisation flag.

Returns
true if the text renderer is initialised, false if it is not

Definition at line 157 of file TextRenderer.inl.

◆ release()

void gVirtualXRay::TextRenderer::release ( )
inline

Definition at line 126 of file TextRenderer.inl.

◆ renderText()

void gVirtualXRay::TextRenderer::renderText ( const std::string &  aText,
float  x,
float  y,
Matrix4x4< GLfloat > &  aProjectionMatrix,
GLfloat *  apBackgroundColour,
GLfloat *  apFontColour 
)

Display some text.

Parameters
aTextthe text to display
xthe x-position of the text
ythe y-position of the text
aProjectionMatrixthe projection matrix
apBackgroundColourthe background colour (RGBA)
apFontColourthe font colour (RGBA)

Field Documentation

◆ m_initialised

bool gVirtualXRay::TextRenderer::m_initialised
protected

Flag set to true when the fond is initialised.

Definition at line 281 of file TextRenderer.h.


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