Jump to content
  • Advertisement


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


Bitmap Fonts: how to load 2 fonts

This topic is 5525 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
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];

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!