Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thedollarhunter

macrumors member
Original poster
May 9, 2011
80
0
UK
Any pointers or experiences good or bad with building a universal app, in particular one that uses OpenGL ES?

I am planning to

Add another nib file with ~ipad.

Check UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad to detirmin iPad or iPhone/iPod.

Set contentScaleFactor if it is available.

Code:
if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] &&
		([UIScreen mainScreen].scale == 2.0)) {
		//NSLog(@"Retina display");
		self.contentScaleFactor=2.0f;//iphone retina scale factor
	} else {
		//NSLog(@"Regular display");
	}

Anything else that needs taking care of?
 
Last edited:
The game I made works great whether on an iPhone or an iPad, even though I only designed it with the iPhone in mind. The controls are just a simple touch left, middle, or right side of the screen, so that simplicity might be part of why it works so well on each device.
 
I did the opposite which was definitely a rookie mistake :mad:

Scaling an iPad game down using glViewport is great but not if you fail to change the controls to suite the smaller screen!

I now know what I am doing this weekend :D


even though I only designed it with the iPhone in mind
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.