开发者

Show a text as texture with OpenGL ES 2.0

开发者 https://www.devze.com 2023-02-03 06:08 出处:网络
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'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?

Than开发者_运维知识库k you.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消