Search code examples
openglftgl

OpenGL: using FTGL and textures


When using FTGL texture fonts, everything works perfectly until I use another texture somewhere else in my program. Then the original texture of the font seems to be lost, and as a consequence, the characters are drawn as black dots. After playing with the various parameters of glTexEnvf, I think the problem is simply that the font doesn't load its default texture back when writing.

Is there a way to access this default texture and bind it before writing?


Solution

  • Try surrounding your calls to rendering the font with

      glPushAttrib(GL_ALL_ATTRIB_BITS);
    

    and

      glPopAttrib();
    

    (as rotoglup suggests.)