Jump to content
  • Advertisement
Sign in to follow this  

Unlit Fonts

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

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);

glListBase(base - 32);

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

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!