Re: [AD] END_OF_MAIN removal patch for msvc

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


On Wed, 2008-11-19 at 19:11 +1100, Peter Wang wrote:
> On 2008-11-19, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > On November 18, 2008, Peter Wang wrote:
> > >
> > > No.  I may want to use Allegro in an environment where my code is not
> > > allowed to block in al_run().  I know it might not work on certain
> > > platforms, but that's my choice to make.
> > 
> > All I really care about is making the api consistent. Meaning the actual code 
> > the user has to write is identical on all supported platforms. None of this "I 
> > don't have to do it here, so I won't, even if it isn't compatible with other 
> > supported platforms".
> 
> So you want to artificially prevent me from using Allegro in some
> situations because it might not be portable to some brain dead platform
> that I don't care about?  Right.
> 

Concrete example of such a situation where "my code is not allowed to
block in al_run()"? Any reason why you can't just fork before calling
al_init &  al_run? I'm not saying al_run is the best or even a good
design, although I do believe it's better than the END_OF_MAIN macro.

What about the alternative, i.e. calling al_process_events periodically?
It has minimal impact to the API, it does not tie you to a paradigm you
may not care about, it does not block. Any downsides?

int main(void)
{
    al_init();
    [...]
    while (1)
    {
        al_process_events();
        [...]
    }
}





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