Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Font Class Reference

OpenGL bitmap font. More...

#include <Font.win32.h>

Collaboration diagram for Font:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual ~Font ()
 Destuctor. More...

void printf (int x, int y, int width, const char *fmt,...)
 Renders a formated string. More...

void print (int x, int y, int width, const string &text)
 Renders a string.

void print (int x, int y, int width, const char *str, int size)
 Renders a c-string of a given length. More...


Static Public Methods

void setFont (Font *font)
 Sets the default font.

Font * getFont ()
 Returns the default font.

int getDefaultFontWidth ()
 Returns the character width of the default font.

int getDefaultFontHeight ()
 Returns the character heigth of the default font.


Protected Methods

 Font (HDC dc)
 Protected contructor. More...


Protected Attributes

int base
 OpenGL display list starting number.


Static Protected Attributes

Font * defaultFont = NULL
 Current default font.

int fontHeight = 20
 The character height of the default font.

int fontWidth = 12
 The character width of the default font.


Detailed Description

OpenGL bitmap font.

Note:
Not class MT save.


Constructor & Destructor Documentation

Font::~Font   [virtual]
 

Destuctor.

Precondition:
An OpenGL context has been created and activated.
Postcondition:
The font display list is deleted.

Font::Font HDC    dc [protected]
 

Protected contructor.

Private OS specific constructor.

Parameters:
dc  Win32 Device context.
Precondition:
An OpenGL context has been created and activated.
Postcondition:
The font is render in an OpenGL display list.


Member Function Documentation

void Font::print int    x,
int    y,
int    width,
const char *    str,
int    size
 

Renders a c-string of a given length.

Renders a string to the current OpenGL context.

Parameters:
x  X position of the string to render.
y  Y position of the string to render.
width  Maximum width in pixels to render.
str  String to render.
size  Length of the string.
Precondition:
An OpenGL context has been created and activated.
Postcondition:
A formated string is rendered.

void Font::printf int    x,
int    y,
int    width,
const char *    fmt,
...   
 

Renders a formated string.

Renders a formated string ala printf to the current OpenGL context.

Parameters:
x  X position of the string to render.
y  Y position of the string to render.
width  Maximum width in pixels to render.
fmt  Format string.
...  List of arguments.
Precondition:
An OpenGL context has been created and activated.
Postcondition:
A formated string is rendered.
See also:
printf.


The documentation for this class was generated from the following files:
This documentation was generated using doxygen. If you have any comments or additions please mail me.