mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
TextureFont Class Reference

Realizes a texture font. More...

#include <TextureFont.h>

Public Member Functions

 TextureFont (GLuint texindex)
 Builds a TextureFont, that is independent of the operating system.
 
 ~TextureFont (void)
 
GLvoid buildFont (GLuint cpl, GLuint cpr, GLuint size, GLuint targetsize, GLuint skipspace)
 
unsigned int getSize (void)
 Gets the size of the texture.
 
unsigned int getWidth (void)
 Gets the width of the texture.
 
void print (int x, int y, const char *string,...)
 Prints a text to the screen.
 
void print (int x, int y, const std::string *text)
 Prints a text to the screen.
 
GLvoid killFont (GLvoid)
 Deletes the displaylists for all 96 characters.
 

Detailed Description

Realizes a texture font.

Texture fonts are fonts based on an image. The image is used as a texture that is mapped on rectangles to display the font.

Author
Jan-Philipp Kappmeier
Date
27/09/2012

Definition at line 21 of file TextureFont.h.

Constructor & Destructor Documentation

TextureFont::TextureFont ( GLuint  texindex)

Builds a TextureFont, that is independent of the operating system.

Definition at line 13 of file TextureFont.cpp.

TextureFont::~TextureFont ( void  )

Destructor sets free the memory using the killFont() function.

Definition at line 22 of file TextureFont.cpp.

Member Function Documentation

GLvoid TextureFont::buildFont ( GLuint  cpl,
GLuint  cpr,
GLuint  size,
GLuint  targetsize,
GLuint  skipspace 
)

Builds a TextureFont on Microsoft Windows

Parameters
cplthe number of characters in one line
cprthe number of characters in one row
sizethe quadratic size of the characters within the file
targetsizethe size that each character should have
skipspacethe space which the next letter should start more right

Definition at line 34 of file TextureFont.cpp.

unsigned int TextureFont::getSize ( void  )

Gets the size of the texture.

Definition at line 68 of file TextureFont.cpp.

unsigned int TextureFont::getWidth ( void  )

Gets the width of the texture.

Definition at line 73 of file TextureFont.cpp.

GLvoid TextureFont::killFont ( GLvoid  )

Deletes the displaylists for all 96 characters.

Definition at line 80 of file TextureFont.cpp.

GLvoid TextureFont::print ( int  x,
int  y,
const char *  string,
  ... 
)

Prints a text to the screen.

The text is allowed to be up to 256 chars. It is assumed that the current projection is an orthogonal projection.

Parameters
xx-position where the text starts
yy-position where the text starts
stringpointer to a char array with the text to be printed

Definition at line 92 of file TextureFont.cpp.

void TextureFont::print ( int  x,
int  y,
const std::string *  text 
)

Prints a text to the screen.

s

Parameters
xthe x-coordinate where the text starts
ythe y-coordinate where the text starts
textthe text

Definition at line 122 of file TextureFont.cpp.


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