View Full Version : 2D rendering on iOS after iPhone 5 support update

04-17-2013, 10:35 PM
Right. So. I'm struggling and I'm not ashamed to admit it!

I'm making an iOS game and hadn't updated proton for a while. Then I got an iPhone 5 and saw that I needed to update the engine to get support for it.

I made a boo boo with my source control setup when I started my project and just took a copy of proton rather than branching or working in the svn repository. And I've been making changes to proton to support irrlicht's 2D rendering which wasn't working before. And I've been working on windows and mac separately with svn only on windows so the update to proton was slightly ropey and painful as I'm sure you can imagine! Lesson learned and all that...

Having now made some progress and got everything compiling and running the 2D rendering isn't working as it was before the proton update. It was all squashed in the y axis initially.

The way my 2D rendering works isn't too barmy... I basically treated everything as if it was 480x320 and then applied retina scaling where necessary before calling irrlicht's 2D render functions.

So if I was drawing a rectangle on retina i would double the size of the rectangle on retina displays. Now, after updating proton it only seems I should double on the y axis but that means the scene is drawn bigger than the screens height by a fair amount on a 4th gen iPod and only slightly bigger than the screen on iPhone 5....

The way in which proton reports the screen size has changed so that the size is reported non-retina and there's a new function to get the screen scale... Any ideas if some changes to all this has affected 2D rendering? Seems like the aspect ratio might be affecting the scale...

I've not actually tried on a non-retina device to see what happens there but wanted to see if something had been done within the engine that could affect 2D!

If you made it this far many thanks, pat yourself on the back!

04-18-2013, 12:01 AM
The changes when I added proper iPhone 5 support did remove some weird cruft from before and things ended up cleaner, (removed some special cases that were needed before) so it should be easier to work with on the iOS side, not more difficult.

Hmm, sorry I'm not sure. :(

04-18-2013, 07:32 AM
Ahh well, I figured there might not be an easy answer. I shall have to dig deeper and see what I can find. I'm just happy that it's sort of rendering somewhat sensibly on both screen sizes now after having all kind of stress from merge hell and spending hours copying data between laptops and for it to inexplicably not be using the full iphone 5 screen!

04-18-2013, 07:52 AM
Ok, no idea if this matters, but a random though:

One of the related recent changes is you should take out SetManualRotation(true) from your App.cpp if you were using that before, it could make a difference as it makes everything now works more iphone friendly without it. (non manual lets the OS do the rotations when you turn the phone upside down, works better)

SimpleApp should now be setup this way as an example.

04-18-2013, 08:05 AM
Yeah I'm pretty sure that line got commented out in the update. I don't imagine it's anything to do with rotation but who knows... I know I had to implement rotating Irrlicht's 2D rendering by sort of duplicating rotateGLIfNecessary.. or something similar to that, that one just did the 3D rotation as you'd not done any 2D work in Proton (had another thread about that last year).

Possibly there's some dodgy scaling i put into that rotateGL2DIfNecessary function which is affecting things... we shall see!