[SDL] iOS Background Event

Jeremy Jurksztowicz jurksztowicz at gmail.com
Thu Sep 29 18:53:22 PDT 2011


As far as I can tell there is a SDL_WINDOW_MINIMIZED event put on the queue,
but I never actually checked to see if that gets to the event loop before
the minimization occurs. I just added my own callback at the point of
minimization in the SDL library, ie in SDL_uikitappdelegate.m:

void (*SDL_IOS_LowMemory)  () = NULL;

void (*SDL_IOS_WillResign) () = NULL;

void (*SDL_IOS_DidResume)  () = NULL;


They are called in the various cocoa callbacks, and then in my code I have:


extern "C" void low_memory ( ) {...}

extern "C" void suspend ( ) {...}

extern "C" void resume ( ) {...}

//...

SDL_IOS_MemoryHook = low_memory;

SDL_IOS_WillResign = suspend;

SDL_IOS_DidResume = resume;


Pretty hacky, but the version I was working with had no way to present a
memory warning at all, so I decided to add the minimize callbacks while I
was there.


There was a thread a while back about adding a new API for platform
settings, similar to the GL attribute API. Anyways, Good Luck!


On Fri, Sep 30, 2011 at 7:18 AM, Brian Barnes <ggadwa at charter.net> wrote:

> I saw there was a discussion a while back about this, but nothing seemed
> decided.  What exactly happens in SDL 1.3 when somebody "minimizes" an iOS
> application?  What event is the one I should be looking for?  Is this likely
> to change?
>
> [>] Brian
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110930/73573b7c/attachment.htm>


More information about the SDL mailing list