You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Reported in version: HG 2.0 Reported for operating system, platform: iOS (All), iPhone/iPod touch
Comments on the original bug report:
On 2012-01-23 08:22:46 +0000, Tim Angus wrote:
Created attachment 799
Convert usage of UIKit coordinates to pixel coordinates
From the patch:
// When dealing with UIKit all coordinates are specified in terms of
// what Apple refers to as points. On earlier devices without the
// so called "Retina" display, there is a one to one mapping between
// points and pixels. In other cases [UIScreen scale] indicates the
// relationship between points and pixels. Since SDL has no notion
// of points, we must compensate in all cases where dealing with such
On 2012-01-25 07:05:44 +0000, Tim Angus wrote:
Created attachment 804
Support retina display modes, but retain non-retina display modes
Alright, this new version implements reporting of the "non-scaled" display on Retina devices, i.e. 320x480 as well as 640x960. If the former is selected (using SDL_SetWindowDisplayMode + SDL_SetWindowFullscreen) a scale of 1.0 is used instead of [UIScreen scale].
The only slight gotcha that I've come across is the fact that calling SDL_SetWindowFullscreen unavoidably disables the iOS status bar. I've tried to disconnect the two things but this implies that a window is both fullscreen and its dimensions are not the same as the display mode's. For example, the display mode might be 320x480, but with the status bar enabled the window size will be 320x460. In itself this is fine, but this breaks the wide spread assumption that the two sets of dimensions are identical and with it various other parts of SDL. So I've left that alone for now. It's not really a big deal though, since I imagine most users will want the status bar disabled anyway.
On 2012-01-31 07:31:26 +0000, Rodrigo Cardoso wrote:
Thanks for the fix, Tim!
I was looking to try fix this, if nobody get their hands dirty first :)
On 2012-01-31 07:33:13 +0000, Tim Angus wrote:
You're welcome :).
On 2012-02-20 09:40:35 +0000, Tim Angus wrote:
Created attachment 826
Fix for double free when quitting on iOS
It seems I introduced a bug with the original fix for this bug. The new patch fixes it.
As alluded to in the email thread "SDL2 error on iOS (doublefree)", I believe the original cause of this bug is confusion over the purpose of SDL_VideoDisplay::current_mode. It looks as though it is a weak reference to another mode, albeit with value semantics. The iOS port treated it as a strong reference however and claimed ownership, which is why things blew up. All the patch really does it to stop treating current_mode as a strong reference.
To prevent this happening again it might be an idea to change current_mode to be a pointer type rather than a value. This would certainly make its semantics much more obvious. Failing that, a comment in the struct indicating its weak reference properties might be wise.