Re: [AD] New event proposals

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


On 2006-01-19, Hrvoje Ban <spoofer255@xxxxxxxxxx> wrote:
> 2) Getting events
> 
> Quick code:
> 
> switch (al_get_next_event_type(queue))
> {
>    case AL_BUTTON_EVENT:
>    {
>       AL_BUTTON button;
>       al_get_next_event(queue, &button);
>    }
> }
> 
> Could be cleaner or uglier depending how you look at it. Good thing it
> allows infinite number of user events and no size limit. Just a idea.

How does it allow an infinite number of user events?  The limit on the
number of event types right now is due to the use of the event enum
for event masks, which restricts us to 32 event types in total.

I don't think the design will be "cleaner" normally.  Most event sources
generate events which have no equivalents in other event sources.  You
would need a separate al_get_next_event(queue, ...) call to each.  And
actually, AL_BUTTON is missing some useful information, e.g. when a
mouse button is clicked you almost always want to know the cursor
position.

Peter





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