The result is this:
The font colour can be changed by simply using glColor3f, and is written with a function DrawString(char *, int, int) which allows you to specify a string, and x ad y coordinates on the screen.
It is currently in use to display the camera location within the field in the upper-left corner of the screen, like so:

Implementing this was actually suprisingly easy. ASCII values for the characters needed are in the range 32 to 127, so converting from a char* to a set of ints was easy. With the value for each character, texture coordinates are calculated on a base "font" bitmap file, and drawn to the screen as a textured quad. Simple!
No comments:
Post a Comment