Jump to content
  • Advertisement
Sign in to follow this  
Erondial

Bitmap fonts

This topic is 4487 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

I'm having some trouble with this bitmap font code I copied from NeHe:
void PutText(int x, int y, const char* text, ColourData* colour)
{
	glLoadIdentity();
	glTranslated(x,y,0);
	glColor4ub(colour->r,colour->g,colour->b,colour->a);
	glPushAttrib(GL_LIST_BIT);
	glListBase(BaseFont - 32);
	glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);
	glPopAttrib();
}
It renders text, but for some reason, when I call it as: PutText(10,10,"Test",&NormalColour); It starts from the bottom left hand corner (It's inside a glEnable2D which reverses the axes, so that's wrong), and then flies horizontally across the screen. I'm not incrementing anything... any idea why it's not working?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!