/**
* Class FontWriter
written by Justin Klein, 2004
*
**/
/**
* Initialize this fontWriter:
* -hWnd must contain a handle to the OpenGL window
* -fontName is the name of the font, i.e. "Times New
Roman" or "Courier New"
* -size,
bold, italic, underline, strikeout specify the style of the font
* -Quality
can be one of: PROOF_QUALITY, DRAFT_QUALITY, NONANTIALIASED_QUALITY,
DEFAULT_QUALITY or ANTIALIASED_QUALITY
*
* NOTE: Fonts created in 2D have their
positions specified in SCREEN coordinates with calls to glRasterPos2f().
*
Also, they MUST be drawn in ortho mode.
**/ BOOLEAN Init2D(HWND hWnd,
char*
fontName,
int size,
BOOLEAN bold,
BOOLEAN italic,
BOOLEAN underline,
BOOLEAN strikeout,
DWORD quality);
/**
* Initialize this fontWriter
with a 3D Extruded Font:
* -hWnd must contain a handle to the OpenGL window
* -fontName is the name of the font, i.e. "Times New
Roman" or "Courier New"
* -size,
bold, italic, underline, strikeout specify the style of the font
* -Quality
can be one of: PROOF_QUALITY, DRAFT_QUALITY, NONANTIALIASED_QUALITY,
DEFAULT_QUALITY or ANTIALIASED_QUALITY
* -extrusion
specifies how far in the -Z direction the font will be extruded
* -format
must be WGL_FONT_LINES or WGL_FONT_POLYGONS, which specifies how the fonts are
drawn.
*
* NOTE: Fonts created in 3D have their
positions specified in World coordinates
**/
BOOLEAN Init3D(HWND hWnd,
char* fontName,
int size,
BOOLEAN bold,
BOOLEAN italic,
BOOLEAN underline,
BOOLEAN strikeout,
DWORD quality,
float extrusion,
int format);
/**
* Cleanup the fontWriter
**/
void
Cleanup();
/**
* Prints the text using printf-style parameters.
**/
void
Print(char *text, ...);
/**
* Returns the character height for this font
**/
int GetSize();
/**
* Cheeseball
function: Allows printing of multiple lines in the middle of the screen (like
for Menus)
* text: a pointer to the text to print
* lineNum: Allows printing of multiple lines,
where 0 is the first.
**/
void
PrintMultiLine(char*
text, int lineNum);
/**
* Cheeseball
function: INSTANTLY prints the text as a single line in the middle of the
screen
* (i.e. clears screen, prints it, swaps buffers). This
shouldn't really be used for anything,
* but i'm cheating :) If
background is NULL, the text is written over the clearcolor...otherwise
* it applies that
texture as a background.
**/
void PrintImmediate(char* text, GLuint *background, HDC hdc);