mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
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. | |
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.
Definition at line 21 of file TextureFont.h.
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.
GLvoid TextureFont::buildFont | ( | GLuint | cpl, |
GLuint | cpr, | ||
GLuint | size, | ||
GLuint | targetsize, | ||
GLuint | skipspace | ||
) |
Builds a TextureFont on Microsoft Windows
cpl | the number of characters in one line |
cpr | the number of characters in one row |
size | the quadratic size of the characters within the file |
targetsize | the size that each character should have |
skipspace | the 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.
x | x-position where the text starts |
y | y-position where the text starts |
string | pointer 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
x | the x-coordinate where the text starts |
y | the y-coordinate where the text starts |
text | the text |
Definition at line 122 of file TextureFont.cpp.