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

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


HS> nah... if we merge the input subsystem, we should do a better job. as i see
HS> it we can remove the distinctions between the various input devices. an
HS> input device can have buttons and axis (which covers mouse wheels AFAIK).
HS> axis can be analogue or digital. so that would leave us with:
I've changed my mind only because of statically linked version.
For me there is no differnce between mouse/keyboard, axis/button
(programmer point of view of course ;]). There are all ints.
Conversion to other types can be made by casting (ugly) or macros
(nice).

HS> AL_INPUT *al_poll_input(AL_INPUT_DEVICE *device, AL_CONTROLLER *controller);
where device->>type can be AL_KEYBOARD, AL_MOUSE or AL_JOYSTICK.
controller->>type can be AL_BUTTON or AL_AXIS. AL_INPUT would be a struct
HS> containing a buffer for buttons, axis info for both analog and digital axes
HS> and a type entry describing what info was fetched. this is just my idea so
HS> far... i don't know what it would look like in the end. the goal would of
HS> course be that it is equally simple to use as today's system and more
HS> powerful. adding some inline functions for fetching info from AL_INPUT
HS> structs will therefore be neccessary. pointers to callback routines can be
HS> put in either AL_INPUT_DEVICE, AL_CONTROLLER or both.
Why AL_INPUT and AL_CONTROLLER are separate structs?
Does it mean that for each axis/button I have to create AL_CONTROLLER
and call al_poll_input? In my approach all data is pulled at once and
stored wihtin AL_DEVICE. Maybe I've misunderstood something.

HS> we can support multiple keyboards, joysticks and mice this way too, which
HS> ought to be nice. i strongly disagree with the people saying a common input
HS> API is a bad idea, they are prejudging an API they haven't seen yet.
I agree if we can handle statically linked version somehow.

-- 
Best regards,
 Grzegorz                            mailto:Grzegorz.Godlewski@xxxxxxxxxx




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