Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

porquilho

Bitmap Fonts: how to load 2 fonts

This topic is 5426 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)

Share this post


Link to post
Share on other sites
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!