Advertisement

Bitmap Fonts: how to load 2 fonts

Started by August 10, 2003 07:16 AM
0 comments, last by porquilho 21 years, 6 months ago
Hello. I''ve looked on the forum about the subject but nothing (some were close). How can I load more that one font and change between them. I''ve made some tests but the frist font to be loaded is the one selected. Thanks... (Sorry about my english)
Well, each bitmap font must have a seperate display list (if you used NeHe''s tutorial, then that''s the ''base'' variable).

I''m guessing your problem is that you first load in a font onto a display list, and then rewrite the display list with the next font.

A very simplified font data structure would be as follows:

typedef struct
{
GLint glDisplayList;
char fontName[64];
float fontColor[4];
} OGLFONT;

So for each font that you load in, you give ogl its own glDisplayList variable. Then when you do glCallLists, you use the font.glDisplayList display list, which should make GL choose the correct font.

-----------------------------
Final Frontier Trader
-----------------------------Final Frontier Trader

This topic is closed to new replies.

Advertisement