Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
TextRenderer Class Reference

#include <Font.hpp>

Public Member Functions

 TextRenderer (Application *app)
 
virtual ~TextRenderer ()
 
FontgetFont (string const &name, uint const size)
 
void begin ()
 
void end ()
 

Private Types

typedef map< string,
unique_ptr< Font > > 
font_map
 

Private Member Functions

void drawBuffer ()
 

Private Attributes

Applicationm_app
 
FT_Library m_ftLib
 
font_map m_fonts
 
Shaderm_shader
 
vector< vec4 > m_vertices
 
GLuint m_verticesBuffer
 
GLuint m_vao
 

Friends

class Font
 

Detailed Description

TextRenderer can be used to render text to the screen.

Definition at line 88 of file Font.hpp.

Member Typedef Documentation

typedef map<string,unique_ptr<Font> > font_map
private

Definition at line 90 of file Font.hpp.

Constructor & Destructor Documentation

Constructs a TextRenderer-object.

Parameters
appThe global application.

Definition at line 218 of file Font.cpp.

~TextRenderer ( )
virtual

Destructs the TextRenderer-object.

Definition at line 249 of file Font.cpp.

Member Function Documentation

void begin ( )

Begin font-rendering. Sets some states that are necessary for font-rendering.

Definition at line 269 of file Font.cpp.

void drawBuffer ( )
private

Draws all vertices in the vertex-vector.

Definition at line 283 of file Font.cpp.

void end ( )

End font-rendering. Resets all states that were set by begin().

Definition at line 277 of file Font.cpp.

Font * getFont ( string const &  name,
uint const  size 
)

Returns a font with the requested name and size. If the font is not loaded jet, it will be loaded from a file.

Parameters
nameThe name of the font
sizeThe size of the font
Returns
The requested font.

Definition at line 256 of file Font.cpp.

Friends And Related Function Documentation

friend class Font
friend

Definition at line 102 of file Font.hpp.

Member Data Documentation

Application* m_app
private

The global application

Definition at line 92 of file Font.hpp.

font_map m_fonts
private

A map of all loaded fonts by their name

Definition at line 94 of file Font.hpp.

FT_Library m_ftLib
private

Freetype-library

Definition at line 93 of file Font.hpp.

Shader* m_shader
private

The font-shader that is used to render text

Definition at line 95 of file Font.hpp.

GLuint m_vao
private

VAO that is used for rendering

Definition at line 100 of file Font.hpp.

vector<vec4> m_vertices
private

All vertices that need to be rendered (before they are pushed to VBO)

Definition at line 97 of file Font.hpp.

GLuint m_verticesBuffer
private

Vertex-VBO

Definition at line 99 of file Font.hpp.


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