[SDL] iOS System Callback

Eric Wing ewmailing at gmail.com
Sun Apr 1 13:13:30 PDT 2012


On 4/1/12, Brian Barnes <ggadwa at charter.net> wrote:
> Piotr wrote:
>
>>> Hi Eric,
>>> I already did an implementation of generic callback mechanism very
>>> similar
>>> to what you described. The initial version with usage instruction was
>>> posted here:
>>> http://forums.libsdl.org/viewtopic.php?t=7733&sid=21dffacbd29855581fe66d8a1126a1df
>>> and the latest version with Android support here:
>>> http://forums.libsdl.org/viewtopic.php?t=8021&sid=1fc02d7d3399878c1a2f11c0a2d94895
>>> I'll try to put it as a file somewhere tomorrow, because it looks like
>>> spaces got messed a bit.
>>>
>>> regards,
>>> Piotr
>>>
>>>
>>
>> Oh cool Piotr!
>
> Piotr's version is where we started all this.  My version was actually from
> another guy's request, which I just implemented so others could play with
> it.  Again, I have no horse in this race, anything that fits the
> requirements for a callback is fine with me, I'm just pushing and pushing to
> have something happen, so I'll implement any idea if it pushes it forward.
>
> If I had to pick, I'd probably go with Piotr's solution as it's more
> open-ended.
>
> NOTE: Eric, this solution is *not* the same solution you proposed (unless I
> am completely mis-reading it.)  Piotr's solution is SPECIFICALLY for
> callback-required OS events, NOT for generic OS events.  It can be tailored
> that way, but I think this is really where you might be getting confused.
> If you only implement it for OS stuff, then later implement it for
> everything else, it WILL break almost everybody's code.

You are mis-reading it. Piotr's solution is what I'm getting at. This
solves your problem in a way that is still compatible and reusable for
other platforms that have the same problem without being a pain for
people on iOS that don't want to use it.

What I am also saying for the third time, that 'very very far into the
future', this could be extended (with a lot of work) to make SDL
optionally event-driven. When I say, very far, I'm likely talking
years from now. But by planting a compatible seed now, minimize future
breakage if/when that time comes.


-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/



More information about the SDL mailing list