Incorrect video mode reporting on "plus" iPhones


I’ve been chasing a strange bug in my app for a while, which i can only verify on somebody elses iphone 7 plus, but I guess the issue is the same for all “plus” iphones. The reported video mode is incorrect.

I have chased it down to this commit:

which (correctly I assume) changes the size of the opengl renderer to match the final resolution (1920x1080) of the plus phones, avoiding one extra scaling step.

However, the same logic is also applied to the reported video modes (in points), which will lead to values that are too big, e.g. 846x476 instead of 736x414.

This will only become an issue if you are actually using these values somehow, which is what I’m doing. I compare these values with the “safe layout area” that was introduced in ios 11 (which is relevant for the iphone X). But due to the invalid values from the video mode, I’m drawing the wrong conclusions.

I propose to remove the “nativeScale” use in case of the computation/reporting of video modes.

Note that the iphone simulator will not help understanding/debugging/fixing the issue, because it’s “nativeScale” property for the “plus” phones is the same as the “scale” property, e.g. “3” - while on a real phone it is somewhere around “2.609”.



Oh! I am relying entirely on the simulator to test compatibility with iOS devices other than those which are ‘physically’ available to me. Can you clarify which releases of SDL are affected by this issue? I’m currently using 2.0.7 for iOS builds (2.0.8 introduces a problem with spurious multi-touch events as I’ve reported previously) and calling both SDL_GetWindowSize() and SDL_GL_GetDrawableSize() to support native ‘retina’ resolutions. On what devices can I expect it to misbehave?

Well, the changeset is dated: Sun, 14 Sep 2014 - thus I’d expect every release after that date is affected.

Ooops, forgot to mention that this should affect all “plus” models (6,6s,7,8) which differ in the “nativeScale” Parameter between Simulator and real device.

Im using
SDL_GL_GetDrawableSize / SDL_GetWindowSize
to get the correct native scale

Ah, that’s what I’m doing, which explains why I haven’t seen the issue.