I want to build a combined iPhone/iPad app rather than separate apps, to quickly test some things. I'll support retina iPhone only, iPad2 and above.
But resolutions on these devices are different - in fact on iPhone you have 3.5" AND 4" versions. And then, on iPhone I want to always use full retina resolution (Scaling Factor=2) but on iPad I want to never use retina (Scaling Factor=1).
How can I sort this out in code, and/or by using multiple ogre.cfg files? Does Ogre know what device it runs on or do I need to use OBJ-C for this? When creating my RenderWindow, can I tell Ogre "just use the device resolution"?
Thankyou.
[iOS] How can I tell device information (iPhone Vs iPad etc)
-
- Goblin
- Posts: 262
- Joined: Fri Nov 18, 2011 6:50 pm
[iOS] How can I tell device information (iPhone Vs iPad etc)
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- Contact:
Re: [iOS] How can I tell device information (iPhone Vs iPad
I would recommend taking a look at Apples UIDevice class for determining what device you are running on and then set window parameters accordingly.
0 x
-
- Goblin
- Posts: 262
- Joined: Fri Nov 18, 2011 6:50 pm
Re: [iOS] How can I tell device information (iPhone Vs iPad
Thanks. I came across this useful macro - UI_USER_INTERFACE_IDIOM() - which trivially identifies between phone and tablet form factor.
I also hadn't realised that Ogre automatically sets a resolution in the GLES2 RenderSystem configuration based on the device screen resolution, in EAGL2Support::addConfig():
I found this after finding the same thing on StackOverflow and was about to implement it when I realised Ogre already did it for me 
However there seemed to be some debate on iPhone status bar and device orientation in that link so I raised this PaperCut: http://www.ogre3d.org/forums/viewtopic.php?f=22&t=80243
I also hadn't realised that Ogre automatically sets a resolution in the GLES2 RenderSystem configuration based on the device screen resolution, in EAGL2Support::addConfig():
Code: Select all
CGSize screenSize = [[UIScreen mainScreen] bounds].size;

However there seemed to be some debate on iPhone status bar and device orientation in that link so I raised this PaperCut: http://www.ogre3d.org/forums/viewtopic.php?f=22&t=80243
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.