Re: [AD] various questions about events (4.3)

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


On 2007-05-07, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> On 5/7/07, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > It's currently limited to the built-in ones.  User-defined events could
> > be added.
> >
> I thought it might be useful, especially for add-ons. For instance,
> the enet networking library uses its own event system. It wouldn't be
> too hard to make it work with Allegro's. (Not that I'm suggesting this
> particular example would be useful; it's just the first thing that I
> thought of.)
> 
> > Yes, it's limited to 32 due to the event masks.  I'm not sure that the
> > event masks weren't a premature optimisation on my part so maybe we
> > should remove them?
> >
> If I had to pick between more than 32 event types or masking, I'd go
> with the extra event types - especially in light of user events.
> 
> If necessary for optimization, I think filtering could be implemented
> by simply not generating the event. (If that makes any sense.)

Well, that's what the masks do.  You apply a mask to an event source and
it only generates events which aren't masked.  Bitfields make the check
cheap, that's all.

> And maybe I've just spent too much time writing web apps, but
> AL_EVENT_MOUSE_MOVE seems like a nicer name than AL_EVENT_MOUSE_AXES.
> Most of the other events are actions, which is a good thing. Along
> those lines, AL_EVENT_TIMER could be AL_EVENT_TICK. But anyway, I'm
> just thinking out loud now.

Sounds fine.

Peter





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