Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Font Problems

  1. #1

    Font Problems

    Hello, I wrote a font function and it worked perfectly in my program but for some reason it doesn't work anymore. I know the font function works right because if I start a new program and use it it works there, but for some reason it doesn't want to display any text in my current program anymore. Are there any functions that need to be disabled before rendering the font? Such as glDisable(GL_CULL_FACE) or anything of the sort. Thanks for the help.

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2003
    Posts
    1

    Re: Font Problems

    You have to disable lighting before redering the font with
    glDisable(GL_LIGHTING)and then enable it again with glEnable(GL_LIGHTING)or you will have problems.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Font Problems

    Things that could go wrong:

    Depth testing, projection matrix, modelview matrix, alpha testing, texture matrix, texture image, vertex format, client enables, mis-matched push/pops, ...

    Try removing pieces of your program until you can get it to work again.

    Also, this is not at all an OpenGL question; this is a general "how do I debug stuff" question. Not that I know of a good "how to debug stuff" mailing list to refer you to, though; everyone I know learned this the hard way.

    Also, you should sprinkle your program with assert(!glGetError()) -- this will pull a full stop when you make some mistake. Then you can go back and debug it. You should put these EVERYWHERE -- they'll be taken out in release mode, so they cost nothing in the final product.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •