Re: [AD] 4.3 Events and polling

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


On 2006-08-08, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> I've been looking at the 4.3 event source/queue system.
> 
> I may not have quite understood it fully, but is there a way for
> al_get_next_event to 'pull' an event from its source?

Not in the current implementation.  The API does not prevent it though,
but I would seriously reconsider whether polluting the implementation is
worth it.

> This would be
> useful for a polling driver where it wouldn't make sense to get the
> value any more frequently than the game's main loop (I'm thinking of
> the joystick)

This should not be necessary with modern OSes & joysticks.  Really the
gameport should be dropped.

> Otherwise you'd have to set up a timer internally which polls the
> source and 'pushes' the event to the queue, which seems inefficient
> because you might poll too often or too seldom.

Right, that's what I do in the Win32 port as a fallback.
See the top of src/win/wjoydxnu.c.

Peter





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