Re: [AD] Proposal for an input model

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


"Eric Botcazou" <ebotcazou@xxxxxxxxxx> writes:

> I'm aware I'm a little too Windows oriented ;-) but the big advantage of
> having an internal asynchronous framework is that input drivers can provide
> private hooks so that the input thread can *block* and not poll (that's
> precisely the case with DirectInput).

For platforms with polled input, like X-windows and other message
based systems, the use of asynchronous framework will complicate
things.  If it is really important to have asynchronous input, maybe
we can provide functions for calling user supplied callbacks
asynchronously.  But systems with polling will call these callbacks
from al_poll_keyboard.

void al_set_keyboard_callback (void (*cb) (something));

'void cb (something)' will be called asynchronously when keyboard
state changes, or when this change is detected in al_poll_keyboard.

BTW, IMHO, it is necessary to poll explicitely, implicit polling in
every input function may give bad performance on some systems.

-- 
Michael Bukin



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