Re: [AD] Proposal for first step towards new api

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


On 2001-12-21, George Foot <gfoot@xxxxxxxxxx> wrote:
[big snip]
> So at the end of the day, I don't think it's very useful to use
> the same function for all devices, and it has potential to get
> in the way.

I agree.  We shouldn't try to hide that different input devices work
differently.  Trying to cram everything into a generalised interface
is like plugging a round hole with a square peg.

> I think I'd just make an interface more like:
> 
>     joy1 = al_install_joystick();
>     al_update_joystick (joy1);
> 
> where joy1 is a pointer to a struct containing driver-specific
> data identifying which stick it is (maybe install_joystick needs
> a parameter for this), some capability bits telling the user
> what the stick can do, and some data for each axis and button
> the joystick has.

I like this.

> Similarly, installing a mouse would return pointer to a mouse data
> struct, etc.

Not sure about this (see next).

> Maybe the keyboard should do the same?

Who has two keyboards in the one machine?  And what's wrong with them?
It'd be a lot of inconvenience (essentially a pointer is moved from
Allegro-space to userspace and passed around like a cheap whore) for
dubious benefit.



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