PDA

View Full Version : Displaying text without glut



Drakkhen
01-10-2005, 05:55 PM
Hi,

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.

Thanx.

Lurker_pas
01-10-2005, 11:26 PM
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"? :) .
See you!

Drakkhen
01-10-2005, 11:44 PM
Yes, it is :)
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.
;)

jwatte
01-13-2005, 07:18 AM
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).

Drakkhen
01-25-2005, 01:31 AM
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. :)