Sign in to follow this  

Bitmap fonts

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

This topic is 4275 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this