Please somebody, look at the code in FLTK 2!

It is drawing text using textures in openGL on X. It uses freetype to 
draw the textures and thus it matches the XFT output.

I believe this code can be modified for other platforms. What you do is 
get them to draw the letters into an image and then use the image as a 
texture.

There also may need some modifications so it can draw more glyphs. 
Currently it cuts off when it has found enough glyphs to fill the 
texture it allocated for the font.

MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> I have thus committed a new algorithm for Mac GL text drawing:
>> 1) Allocate a pile of pre-computed textures of default size 100.
>> 2) To draw a text string do
>>    - if the corresponding texture is in the pile, map it to 
>> the GL scene
>>    - if not, pre-compute the corresponding texture and map it
>>       + if the pile is not full, put the texture in the pile
>>       + if not, remove the most ancient pile element, and put
>>         the new texture in the pile.
> 
> 
> Also: we need that functionality under X11 as well, how re-usable is
> this code? Can it be made to work for the X11 text rendering under GL?
> 
> I don't know about the win32 WGL_* text rendering - it might just work,
> it is possible the MS did this right!
> 
> If not, we can leverage this code again for the WGL versions too?
> 
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to