6

I'm developing an Android 2.2 application. I use C++ to manage all OpenGL ES 2.0 stuff.

I want to show a text with OpenGL, but I don't know how (I'm very, very new with it).

I read that I can render common strings to textures, and simply draw those textures. But how can I do that?

Thank you.

VansFannel
  • 45,055
  • 107
  • 359
  • 626

2 Answers2

2

This has already been answered right here on Stack Overflow.

A very basic and useful approach is to store a rendered alphabet in a texture. Then you can write your own method to lookup every character of a passed string and draw it to the screen.

Community
  • 1
  • 1
Matthias
  • 7,432
  • 6
  • 55
  • 88
  • 2
    That solution isn't C++ :-( I think he's after a C++ answer. (So am I BTW) There are some ES 1.1 solutions out there, but not an obvious 2.0 solution yet. FTGLES is close. – 101010 Apr 24 '11 at 15:51
2

You can use Cairo to render text (with any unicode font) to a texture and then map the texture directly.

thomasfedb
  • 5,990
  • 2
  • 37
  • 65
Sandeep
  • 21
  • 1