开发者

write text using open gl in iPhone

I want to write simple program in openGL of how to draw text "Hello World" in openGL using xcode for iphone开发者_开发问答 development.

Thanks.


71squared includes a series of tutorials about iphone game development with opengl es. You can find the part of "font" from http://www.71squared.com/2009/04/iphone-game-programming-tutorial-4-bitmap-font-class/


The GLUT library has some wrappers for this but I don't think you can use it on iPhone. You will have to either use a different library or implement your own. A different idea is to use existing controls and stealing their bitmap rendering. This is a bit questionable.

I would advise implementing your own, text rendering is basically rendering quads in glOrtho with the texture coordinates of one specific letter. It will be much easier to adjust to your needs. Monotyped fonts are slightly easier to program than others.

See this thread for other possible solutions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜