I'm using C++ to write a small 2D app with SDL and OpenGL. I'm trying as much as possible to keep my code cross-platform. However, I've hit a bump. I can't find a good, easy way to display text on the screen. I am able to do it, but not the way I would like to.
I've tried using the built in bitmapped fonts OpenGL has, but that doesn't give me much control over fonts, sizes, and orientation.
Right now, I'm using SDL_ttf to create an SDL_Surface with my text. From there, I tried two things.
First, I tried creating an opengl texture with the text. This gives me lots of control over it, but the font rarely pixelizes exactly, and it becomes blurry and hard to read, and the font always has a background color. I can't just render ONLY the font.
Second, I tried calling glDrawPixels(...) on the SDL_Surface I got when generating my text. This approach pixelizes correctly, but it brings back the bitmapped font problem: no control over size and color. And for some reason, I can't render my fonts on top of opengl polygons. On background, the fonts are clear and visible, but the polygons seem to cover them up.
I know that OpenGL doesn't have a built in facility to render fonts. So could anyone recommend a good library for me to render True Type Fonts with OpenGL WITHOUT RENDERING THEM TO A SURFACE/TEXTURE?
And please don't suggest FTGL or its relatives. I tried it, and it failed to compile because of an error in the header.