Displaying text without glut


currently working on a small engine, I started using glut lib. Now I’m quite advanced in coding it, I just realise the only reason I have glut was for displaying text. So I looked on-line for some samples explaining how to display text without it (since my personnal attempts failed) and the only working ones I find are glut based (again) or use some blurry texture render trick.

How can I simply display common bitmap font strings using just gl.h and glu.h? …if possible.


I’m not sure whether it is what you want, but have you tried Nehe Tutorials(Bitmap Fonts and Outline fonts)?
It’s on nehe.gamedev.net.
Personally I generate texture (in a separate program) with font characters, and then draw textured quads. It’s not ideal, but for me it’s sufficient(is this your “blurry texture render trick”? :slight_smile: .
See you!

Yes, it is :slight_smile:
Anyway… I mistakenly found wgl functions and managed to do a Outline font display routine but am still stuck on the wglUseFontBitmaps. I think I’m close enough now.
Thanx for NeHe suggestion, I’ll have a look at it if I’m exploring a dead-end solution.

If you want a variety of typefaces, typographic control, and the highest possible vertex throughput, then I’ve found the best way to draw text to be drawing into an offscreen bitmap using the native text drawing API (GDI on Windows; FreeTyle on Linux), and uploading the entire drawn text as a texture (or sub-loaded part of a texture).

That’s exactly what I avoided to do.
wglUseFontBitmaps seems far more performant if I rely on my FPS counter compared to texturing based system I tried first (what I called “blurry”).
Bitmap fonts work just fine, I only have to figure out what projection to use for outlines. :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.