Xcode GLKit printing Text on GLKView without using UIImages -


i have app, small game using opengles glkit. no im wondering how works when want draw text on screen (if possible).

how can it?

i draw of game objects using images (wrapped in kind of sprite). possible scale, move, , rotate. works fine.

but finding out how works print text on glkview gets me deep inside of problems ^^

i dont want use uiimages cause dont know how present uiimages on glkview.

there number of ways want:

1) have image text glyphs need in it. example, if application in english, you'd have 26 uppercase , 26 lowercase letters in image. upload texture gpu , use proper texture coordinates or glsubteximage2d() pull out glyphs need. (it's not clear me if meant not wanting uiimage. doesn't have uiimage, though that's easiest.)

2) every time need display text, draw on cpu on fly, , upload entire word, phrase, or sentence texture. create cgbitmapcontext , use core graphics draw text it. upload using glteximage2d().

3) individual glyphs out of fonts , draw directly using bezier curves make glyphs. allows 3d extrusion, too. however, option time consuming code , least performant. involves dealing many small problems fonts have (like degenerate segments, , incorrect winding orders). if want go down path, think maybe core text can help.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -