Re: [AD] Allegro main function in separate library

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 26 Jan 2010, at 13:35 , Elias Pschernig wrote:
> To be honest, I'm not 100% sure that there isn't a way to deliver the
> events to something besides the main thread. Objective-C itself doesn't
> seem to give special treatment to any thread. And the tests which were
> conducted back then (by you and Peter Hull I think) just showed that the
> system messages wouldn't arrive - but never why they didn't arrive.

I didn't have a Mac back then. I looked back through the history, the Mac OS X port wasn't contributed until around the time of 4.0.1 and there was no stable version of Allegro supporting OS X until 4.2 came out (actually, that may have been part of the reason we felt that pushing out 4.2 was a good thing to do at the time). You're probably thinking of Angelo Mottola.

> And
> I found out the same thing while making the initial prototype of the
> iphone port - only if I had all of the app delegate stuff in the main
> thread things would work. But I never understood why they would stop
> working if i moved everything to another thread.
> 
> This just means, if an OSX and objective-C and threading expert spends a
> few hours looking at this, there is a chance we can remove the
> main-macro even under OSX.

That'd be neat.

> But the way things are set up now, this
> wouldn't require any API changes, A5 code would keep working without a
> change and if recompiled the main() simply would be the real main
> instead of a macro.

Yup. That would really be the icing on the cake. I'm afraid it'll be a couple of years before we can have that and eat it. ;)

> Yes, great work - now I can finally make my Python wrapper work under
> OSX :)

I'm anxious to see what problems you'd run into. There's probably a few things that we've missed somehow that need to be taken care of. In particular, I hope there is no dependency of the main library on anything that is defined in allegro-main. If there is, writing a custom wrapper to resolve the dependency *and* integrate with whatever it is you want to integrate with would do the trick, but hopefully it'll just work without such a hack.

Good luck! :)

Evert



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/