Re: [AD] mouse_api branch

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


On 2006-09-01, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> On 9/1/06, Peter Wang <tjaden@xxxxxxxxxx> wrote:
> > How's that?
> >
> Yes, fine with all of that. Under this scheme, what is AL_MOUSE for?
> At the moment it only has one field, the event source. It could be
> dropped (and a get_event_source vtable function added to the driver)
> or it could be given more features (for example,  get_num_axes and
> get_state could take AL_MOUSE arguments)
> 
> This is not vital but IMO it would be nice to see some commonality
> between APIs for
> AL_KEYBOARD
> AL_MOUSE
> AL_JOYSTICK
> the difference being that there is probably only ever going to be one
> mouse and one keyboard, but there may be more joysticks.

Would it help to think that most of the keyboard API and the mouse API
functions take AL_KEYBOARD* and AL_MOUSE* arguments, but, as a
convenience, they are implied?


Of course you're right that AL_KEYBOARD and AL_MOUSE are only there now
to hook up the keyboard and mouse APIs to the event subsytem.
You're wondering if we should replace al_get_keyboard() with:

    AL_EVENT_SOURCE *al_get_keyboard_event_source(),

and similarly for the mouse, right?  That makes sense now.  I suppose
we'd need:

    AL_EVENT_SOURCE *al_joystick_get_event_source(AL_JOYSTICK *)
    AL_EVENT_SOURCE *al_display_get_event_source(AL_DISPLAY *)
    etc.

to keep things similar.  It avoids the typecasts of the current API at
least, but is even more verbose.

Peter





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