Reputation: 552
I am trying to create an OpenGL app for iOS using monotouch. I need the app to support the new retina display resolution of 480x960, as well as 240x320 for the 3GS and earlier.
The out of the box OpenGL sample solution does not support this. When I run on my iPhone 4 it just displays a blurry, upscaled 240x320 version of the OpenGL view.
Surprisingly, Google has help for OpenGL and retina, as well as monotouch and retina, but not OpenGL and monotouch and retina. I have tried inspecting and tweaking with the ContentScaleFactor of both the EAGLView and the main UIWindow to no avail.
Strangely the ContentScaleFactor for both is 1.0 and not 2.0 like related literature suggests. Additionally the Screen property of the UIWindow has bounds of 240x320 at runtime, even though it is running on an iPhone 4 retina display.
Does anyone know how to properly support retina with OpenGL on monotouch?
Upvotes: 0
Views: 859
Reputation: 436
The Screen
object also should have a Scale
property, which should be equal to 2.0 on a retina display.
As an example, MonoGame sets the view's ContentScaleFactor
to MainScreen.Scale
explicitly (https://github.com/mono/MonoGame/blob/master/MonoGame.Framework/iOS/IOSGameWindow.cs#L109).
Upvotes: 1