Unlit Fonts

Started by
1 comment, last by hannibar 19 years, 1 month ago
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.
Advertisement
The only thing that come to mind is if you are turing lights on in your printing function. I'm assuming that you are using 3d fonts right. I'm not sure which tutorial it is.


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]

This topic is closed to new replies.

Advertisement