Force a retina iPad to use non-retina images - opengl-es

I'm creating an app using OpenGL...
I have a retina iPad, and I'm using a texture that stores #2x images. When my app starts up, the OpenGL framebuffer is created and querying the size of it comes back as 1536x2048 - so far so good.
I also have a texture for non-retina iPad display (768x1024), but I do not have a non-retina iPad. I'd like to force my retina iPad to use the non-retina graphics (i.e, for it to use scale == 1.0). So I'd like it to create a 768x1024 OpenGL framebuffer. The problem is that it always creates a 1536x2048 frame buffer, and scale is always 2.0.
Is there a way of forcing it to use a scale of 1.0, and creating a smaller framebuffer? The base iOS version for the app is 8.0, but since iOS8.0 still works on the iPad2, I'd like to test that resolution as well.
I've tried using UILaunchImages, but that doesn't seem to work? In the past, when an app was written for a non-retina screen, a retina device used to scale the lower resolution to fit the higher-resolution screen, and that's what I want - at least so I can test....
Is UILaunchImages the right way to go to try and get iOS to think that only low-res graphics are available?

IIRC, simply by having an #2x resource (splash, icon, etc..) used to signal iOS that you are running an app with support for Retina. I think since then Apple has added a NSHighResolutionCapable key that you can try to set false in the plist. So try removing all #2x resources from your build and setting that key to false.
Another approach is to change your glViewPort and/or the Projection matrix to scale your logical resolution to 1024x768. I have the opposite problem in that I need to scale non-retina images up to the retina backing scale. I use a Scaling matrix in my stack to fix this.
Ask me how I mix and match retina and non-retina images!

Related

poor performance using layer-backed NSOpenGLView

I'm updating my OS X app to use layer-backed views, so I can have Cocoa views on top of my OpenGL rendering (I haven't added any Cocoa views yet). Without layers, I get 60fps. With layers, less than 15fps. My iOS version, where everything is layer-backed, gets 60fps.
I enabled layer backing thusly:
I also had to set the layer's background color to black to avoid bad compositing (I use OpenGL blending, so the final alpha values in the buffer aren't correct for CA compositing).
According to Instruments, most of the rendering time is spent in CA::Transaction::commit:
I tried clearing the alpha channel as recommended here, but this seems to be just an alternative to setting the layer's background color to black.
FWIW, here are the settings for my OpenGL view:
I'm on OS X 10.10 Yosemite.
According to posts on the Apple developer forums, this appears to be a bug in OS X 10.10.

Get iPhone 5s app to scale to iPhone 6 resolution in Xcode Storyboard

I want my iPhone 5s app to simply upscale for the iPhone 6. I have no Launch Images in the project, but I do have the interface builder location declared in the plist to get rid of the black bars. How can I get the app to just upscale, right now it shows white space in Storyboard.
Looking at your question it looks like you are using absolute frame values for positioning, by setting frame.size.{width, height} and frame.origin.{x,y}.
You have two options.
set those values programatically. It's not recommended at all but might be easier to setup. Detect what is the screen's size with [[[UIScreen mainScreen] bounds] size] (check for the height property) or detect the device's version (eg Determine device (iPhone, iPod Touch) with iPhone SDK).
a less slippery road is to transform your project an start using AutoLayout. There's a learning curve but it guarantees that your project will be fitting well any screen. Start here: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html

What happens when you connect non-retina display to MBP with retina?

AFAIK Mac OSX has unified screen space. So it's unclear to me what happens when you have multiple displays with different backing scale factor. Will retina display go into low-res mode (so -[NSScreen backingScaleFactor] returns the lowest value among all attached displays)? If no, how an app will be rendered if it's placed so part of it appears on display with retina and another part appears on display without retina?
I'm working with some HiDPI issues at the moment, and I have my not retina MBP and thunder display with turned on HiDPI mode on it.
On connected display, it has 2.0 backing scale factor, and when I drag the window to MBP display (which has usual DPI), next is happening:
When the major part of window is on HiDPI, it renders all the window with backing scale factor 2.0.
When the major part moves to non HiDPI display, it rerenders all graphics with backing scale factor equal 1.0, and shows new rendered window on both displays.
Hope it will help you)
EDIT: screenshots added.
Screenshots near the displays border (Usual on the Left, Retina on the Right):
backingScalefactor 1.0:
https://dl.dropbox.com/u/51547223/Backing1.0.png
backingScalefactor 2.0:
https://dl.dropbox.com/u/51547223/Backing2.0.png

how to set image for ipad application that support retina display

i need to update my application so it can support retina display in New iPad, but i still have some doubt about it. Is it right that we have to create a new image that support the resolution for retina display and still keep the last image for the application without retina display support? If yes, so our app will have a big size, right? Is there any way to make it just one? Maybe just use the high resolution image, but resize them for the regular application (the application that did not support retina display). Can somebody help me?
You have to create two images. one for old resolution and one for retina display.
If i remember, you have only to add #x2 on retina images:
mypicture.jpg (old display)
mypicture#x2.jpg (retina display)
I hope, this way is similar to the iphone.
For web you can still use the #2x naming convention.
Declare the background image and set the size.
In the retina display media query call the high-res image.
figure{background-image:url(../img/imageName.png);background-size:57px 57px;}
#media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
figure{background-image:url(../img/imageName#2x.png);}
}
There are server side solutions too, here's one: Link

set ios screen resolution in xcode4 storyboard

Am working on an ipod/iphone application that primarily captures a photo. Am designing the flow in xcode4 IB storyboard.
However, as you can see from the image it is taking the default resolution as 320x480 which causing the preview on ipod retina display to show up in a corner than full screen. How can I make the IB get device resolution and adjust the ratio accordingly?
I tried looking at project settings, build settings, info.plist however couldn't find an answer yet.
Thx
Those dimensions are in points, not pixels. They are correct. On retina displays, 320 points are equal to 640 pixels. If your application is only showing up in a quarter of the screen, it's likely the problem is in your code, not in how you have set things up in Interface Builder.

Resources