SDL & iOS minimize/restore

Just wanna share the solution to a problem I’ve had in the recent days and
that I’ve solved:

The problem I had on iOS was that after a minimize/restore operation (press
home button and then click on the app icon), the graphics of my app
shrinked in the sense that the destination surface was smaller that the
original one and the mouse coordinates was all wrong. Getting window size
with SDL_GetWindowSize() reported no change.

I’m quite sure this has something to do with the title bar (that is hidden
in my game) , that spawns for a few frames when you restore the app.

I was confused by the fact other people do not have the same problem and I
found the problem is that if you use SDL_RenderSetLogicalSize(), you have
to issue a new call to it every time you receive a SDL_WINDOWEVENT_RESTORED.

I think this operation will be better suited to be done inside the
SDL_uikitappdelegate.m:applicationDidBecomeActive while iterating windows.

Anyway the workaround I’m using seems quite solid.

I’ve also seen that with this patch from David Ludwig it’s no more
necessary to use SDL_iPhoneSetAnimationCallback() for game center support!

To bad that I’ve updated my HG version of SDL today after spending three
days adapting the game to NOT keeping the main loop control…–