I have been banging my head against this for a while and I just cannot seem to figure out what is causing this issue.
I have an iPad app that runs only in landscape mode. I need to support both 1024x768 and 2048x1536 resolution screens, and define a viewport and protection for opengl using the device's screen resolution.
This all works fine on 1024x768 devices
However when running on 2048x1536 devices, [UIScreen mainScreen].bounds is still returning 1024x768
I am only targeting iOS 7.0 and later, and I have an asset library set up with launch images. I have even included launch images for portrait mode just to be safe.
I have 4 launch images (which are just white pngs): iPad Portrait iOS 7,8 1x: 768x1024 iPad Portrait iOS 7,8 2x: 1536x2048 iPad Landscape iOS 7,8 1x: 1024x768 iPad Landscape iOS 7,8 2x: 2048x1536
Still, when the application launches, I am getting the wrong screen dimensions, so my OpenGL view only takes up 1/4 of the entire screen
Any help would be GREATLY appreciated
EDIT:
I modified the launch images so I could see which one it is using, and it is using the 2x Landscape image, as expected, but still the returned resolution is incorrect.
[UIScreen mainScreen].scale
into account. For a non-retina device it will be 1.0 and for a retina device it will be 2.0. – AdamPro13