SDL Digest, Vol 49, Issue 63

Message: 5
? ? ? ?<AANLkTin5S90+Cyk8gjSqovmMyyCSREBsTYKGZSz0BgDU at>
Content-Type: text/plain; charset=“iso-8859-1”

This is definitely a good thing to think about with SDL on any mobile

A good example of this is the application life cycle on Android. ?The
expected application life cycle is documented here:

The important point is that between Pause and Resume, the application loses
its OpenGL context, which isn’t accounted for anywhere in the typical SDL
application. ?In order to handle this, currently the SDL code sends a QUIT
event and waits for the application to quit. ?If the application doesn’t
quit in response, it will eventually be killed by the OS.

This is an example where the SDL behavior is okay, but there must be a
better way. :slight_smile:
As far as the OpenGL context, I’d advise adding appropriate values to
the Active event structure, but I think it should go a little bit
further than that, since Active mostly just makes sense with windows.

I propose adding a ‘System’ (there’s probably a better name) event for
this, with at least a Reason code. It could be used to provide
notifications on power management, pause/resume, and whatever else
makes sense.

Alternatively, maybe provide a function in the PWM system to register
a void pointer / user function pair that gets informed of this sort of
thing on those platforms that provide some reasonable way to implement
it?> Date: Sun, 16 Jan 2011 16:04:01 -0800

From: Sam Lantinga
To: SDL Development List
Subject: Re: [SDL] pygame subset for android