On 01/11/2014 05:59 AM, Benoît Minisini wrote: > Le 11/01/2014 09:14, Kevin Fishburne a écrit : >> On 01/10/2014 10:56 AM, terco IDE wrote: >>> Hi, does anyone has an example on rendering some text in a glArea with (or >>> without) openGL? >>> >>> tnx! >>> >>> Saludos >>> 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. > 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 Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user