Opengl and fonts

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

Opengl and fonts

Postby Hachaso » Thu Mar 04, 2010 11:31 am

Hi!

Could someone please help me with fonts and Opengl.
I have been looking at the Nehe Lessons 13 and 14. Unfortunately I can't get it to work with Android.
Does anyone know how this could be done?

Any code examples or any article?

Thanks
Hachaso
Developer
Developer
 
Posts: 43
Joined: Mon Jan 26, 2009 11:44 am

Top

Postby r3dknight » Thu Mar 11, 2010 12:13 am

something like this?
Image
Image

darn thing is slow since it pop and push the matrix stack for every letters
Image
r3dknight
Freshman
Freshman
 
Posts: 7
Joined: Wed Mar 10, 2010 11:45 pm

Postby Hachaso » Thu Mar 11, 2010 9:43 am

Hi!

That is exactly what I would like to do.
I can't manage to get it working properdy.

Do you have any example or tutorial of how this is done on Android?

Thanks
Hachaso
Developer
Developer
 
Posts: 43
Joined: Mon Jan 26, 2009 11:44 am

Postby r3dknight » Thu Mar 11, 2010 1:02 pm

well.... :P :P

I can tell you how.

-> Nehe uses glList which is not available on GLEST

so how do you keep tracks of all the font list?

well I just create another array to hold texture coordinates of each individual font.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  private float[][] Fonts = new float[256][8];
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


:wink:
r3dknight
Freshman
Freshman
 
Posts: 7
Joined: Wed Mar 10, 2010 11:45 pm

Postby Hachaso » Thu Mar 11, 2010 1:07 pm

Thanks!

do you have any code snippet to share?

You wrote that it's quite slow to render the fonts.
Any other way that is faster?
Hachaso
Developer
Developer
 
Posts: 43
Joined: Mon Jan 26, 2009 11:44 am

Postby r3dknight » Thu Mar 11, 2010 3:04 pm

snippets code share?

I feel very depressed and not in a sharing mood....
and beside the code look very similar to Nehe's font codes

it's slow because of using the push and pop matrix to position the fonts.
it can be done faster if you alter the drawing position of the rect however..
which is also bothersome to do since you have to alter the drawing vertices and load it back
r3dknight
Freshman
Freshman
 
Posts: 7
Joined: Wed Mar 10, 2010 11:45 pm

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests