...continua...
" Got it working after moving code from glaPresentation_KeyPress to Form_KeyPress, but it's not the
kind of text rendering I need because the GLArea will be a mixed between a structure (a building) some text data.
Just thougt about a little hidden Picturebox to print the text with usual methods and then past the image from memory into the GLArea when rendering. Do you think that would work?
Martin "
" Yes (using OpenGL), but it's rather involved. I had an epic failure of
hardware and human logic this week and am just wrapping up restoring
sanity to my server and workstation, but give me a day or so and I'll
give you the source code.
It's my understanding that OpenGL has no native support of rendering
text, that it must be done manually. I can also provide you with a
couple of "fonts" that I created from ttf.
Basically you take a ttf, type out all the characters you want in GIMP
(I recommend keeping them in line with an ASCII table), then save each
character into a separate png file with alpha. You then load these into
OpenGL textures and render them as quads. The horrible bit (as if it
weren't horrible enough) is getting the spacing right for different
combinations of characters. You'll want to add drop shadows, beveling,
etc. in GIMP as I don't know of a way to do this in OpenGL other than
perhaps by using shaders (zero knowledge there).
Using Gambas's native software text rendering libraries is slower but easier.
Kevin "
" Why slower? You can use Gambas to create the font characters texture,
and maintain a texture cache to not do that each time a character is drawn.
--
Benoît Minisini "
" That's a good point. It's actually exactly what I do with the the
landscape tiles for my game using the DrawAlpha function. Composite each
tile using Gambas software operations, then offload it to an array of
OpenGL textures for on-screen rendering. I never thought the same could
be done with text.
In any case, let me know Martin if you're interested in my text
rendering code and bitmaps. I finally got everything up and running here.
kevin "