How do I draw fast Text ?

I am trying to draw some text labels using OpenGL, but it is nowhere near as fast as the GDI functions in VC++. Is there any guidelines to generating very fast test labels ?

Hi
I am still attempting to draw some simple text onto my view, but I still find it very slow indeed. Any help would be appreciated

regards
pk

Originally posted by Paul Kennedy:
I am trying to draw some text labels using OpenGL, but it is nowhere near as fast as the GDI functions in VC++. Is there any guidelines to generating very fast test labels ?

There are many ways to draw text in OGL, outlined font, bitmap font and (the fastest IMHO) texture font.

I think the fastest is the last one, drawing small textured quads for each char using the right texture coords.

Imagine to have a texture on wich are drawn all the characters you need :

1 2 3 4 5 6 7 8 9 0 a b c d e
f g h i j k l m …

better to use the ASCII code order (it will be easyer to pick the right coordinates for every char).

Then you draw billboarded quads for every char in the string you need to write, and pick for every quad the right coordinates to have the right letter on it.

It’s more easy than you may think.

you’ll find some tutorials on displaying font on nehe.gamedev.net

hope this helps

rIO.sK http://www.spinningkids.org/rio