Sign in to follow this  

Unlit Fonts

This topic is 4662 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've followed tutorial #14 to create fonts. This works very well, but when I have lighting enabled, the font is also lit. I haven't found a way to make it 'unlit' yet. I tried this : glDisable(GL_LIGHTING); printGlText ("test"); glEnable(GL_LIGHTING); but the results are exactly the same. Does anyone know what I can do ? Thanks in advance.

Share this post


Link to post
Share on other sites
Sorry I was mistaken. I am following tutorial #13, the one that handles bitmap fonts.
This is the code for the printing function :

void printText (const char *input, ...)
{
char text[256];
va_list ap;

if (input == NULL) return;

va_start(ap, input);
vsprintf(text, input, ap);
va_end(ap);

glPushAttrib(GL_LIST_BIT);
glListBase(base - 32);

glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);
glPopAttrib();
}

So as you can see, I'm not turning on lights is this function.
I'm actually doing exactly the same as what tutorial #13 describes, with the difference that I added light in the scene.

To be honest, I'm not 100% sure that the problem is the lighting, but I try to give the text a green color by calling glColor3f(0.0f, 1.0f, 0.0f), and the outbut is black. When I disable the lighting for the whole scene however (when I don't call glEnable(GL-LIGHTNING) in initGL ), the text is drawn in the color I want.

[Edited by - hannibar on March 9, 2005 3:57:23 AM]

Share this post


Link to post
Share on other sites

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