Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-29-2009, 01:37 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: currently AZ
Posts: 112
kingbombs is on a distinguished road
Send a message via MSN to kingbombs
Default Writing in OpenGL ES

Hey,

So i have been searching and searching the internet looking over Bitmapped fonts tutorials for writing text with OpenGL.
All i want it to do is show an integer (my frames per second) in one corner.
And then at 1 or 2 other places on the screen just another integer that is 2 or 3 digits big.

I don't care for changing and creating loads of fonts or changing the font.
I just want to display the integers on the screen without having a frames drop (apparently using a UILabel will cause that?)

If anyone can point me in the right way of a tutorial that is useful (or provide code samples) and doesnt bother with how you can change fonts or one that is just simple to use, i have tried two or three and both do it quite differently from one another but requries me to change most of my code as well as use external programs to download fonts (kinda pointless for me)
kingbombs is offline   Reply With Quote
Old 06-29-2009, 01:50 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
NewiPhoneDeveloper is on a distinguished road
Default

Quote:
Originally Posted by kingbombs View Post
Hey,

So i have been searching and searching the internet looking over Bitmapped fonts tutorials for writing text with OpenGL.
All i want it to do is show an integer (my frames per second) in one corner.
And then at 1 or 2 other places on the screen just another integer that is 2 or 3 digits big.

I don't care for changing and creating loads of fonts or changing the font.
I just want to display the integers on the screen without having a frames drop (apparently using a UILabel will cause that?)

If anyone can point me in the right way of a tutorial that is useful (or provide code samples) and doesnt bother with how you can change fonts or one that is just simple to use, i have tried two or three and both do it quite differently from one another but requries me to change most of my code as well as use external programs to download fonts (kinda pointless for me)
You could try the Texture2D class from the CrashLanding project. I've only used to to draw textures so far, but it has a convenient way to render strings too.

The method it uses, goes like:

Code:
- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size
If you don't have the Texture2D class, PM me with your email adress and I'll send you over the CrashLanding project folder. I guess Apple pulled it off the example's website a while ago.
NewiPhoneDeveloper is offline   Reply With Quote
Old 06-29-2009, 03:58 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: currently AZ
Posts: 112
kingbombs is on a distinguished road
Send a message via MSN to kingbombs
Default

Quote:
Originally Posted by NewiPhoneDeveloper View Post
You could try the Texture2D class from the CrashLanding project. I've only used to to draw textures so far, but it has a convenient way to render strings too.

The method it uses, goes like:

Code:
- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size
If you don't have the Texture2D class, PM me with your email adress and I'll send you over the CrashLanding project folder. I guess Apple pulled it off the example's website a while ago.
Hey i don't really want to use the Texture2D class.
If i do use it though, will apply still approve my app?
Only reason i ask is because the tutorials: iPhone opengl es tutorial series ?
the author mentioned two books he has seen use apple undocumented code, and that won't let your apps be approved.
I don't know if he was refering to that but if he is then don't want to use something that wont get approved.
kingbombs is offline   Reply With Quote
Old 06-29-2009, 04:30 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
NewiPhoneDeveloper is on a distinguished road
Default

Quote:
Originally Posted by kingbombs View Post
Hey i don't really want to use the Texture2D class.
If i do use it though, will apply still approve my app?
Only reason i ask is because the tutorials: iPhone opengl es tutorial series ?
the author mentioned two books he has seen use apple undocumented code, and that won't let your apps be approved.
I don't know if he was refering to that but if he is then don't want to use something that wont get approved.
Now you got me worried Why shouldn't Apple approve apps, using the Texture2D class? Is there something wrong with it? No, I guess you missunderstood that. The Texture2D class was originally written by Apple and in my opinion it's a great way to get fast 2D drawing results in openGL. I've successfully tested it on various versions of the SDK and it works just fine.
No worries, using this class won't get you into any trouble.
NewiPhoneDeveloper is offline   Reply With Quote
Old 06-29-2009, 05:17 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: currently AZ
Posts: 112
kingbombs is on a distinguished road
Send a message via MSN to kingbombs
Default

EDIT:: Ok asked on irc and apparently thats not true i might look into it then

It looks like for Bitmapped drawing im going to have to import some other program anyway.

Last edited by kingbombs; 06-29-2009 at 05:46 PM.
kingbombs is offline   Reply With Quote
Old 06-29-2009, 07:28 PM   #6 (permalink)
Tutorial Author
 
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 29
mauriceatron is on a distinguished road
Default

Quote:
Originally Posted by kingbombs View Post
EDIT:: Ok asked on irc and apparently thats not true i might look into it then

It looks like for Bitmapped drawing im going to have to import some other program anyway.
kingbombs,

there's no problem with using Apple code like Texture2D. The only issue that was being referred to is the use of Apple's Private API's.

If you want to render simple text, there will be no problem using the text portion of the texture 2D class.

For further reading of the whole private API issue and the app store, read this:

Unpublished iPhone API crackdown in progress - Ars Technica
mauriceatron is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 329
9 members and 320 guests
chiataytuday, coolman, givensur, ipodphone, jbro, mtl_tech_guy, Punkjumper, vilisei, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:15 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0