Re: Re[4]: [AD] Proposal for first step towards new api |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Grzegorz Godlewski <Grzegorz.Godlewski@xxxxxxxxxx> wrote:
> 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.
No, no... AL_INPUT contains the input data from the input device, while
AL_INPUT_DEVICE is an interface for a given input device which has one or
more AL_CONTROLLER interfaces for it's axes or buttons. these should be
created automatically when the input subsytem is activated/installed.
AL_INPUT and AL_CONTROLLER don't strictly need to be separate. the input
data can be contained within AL_CONTROLLER if that's desireable, and
al_poll_input() can just return zero or non-zero depending on whether there
was new input available or not. I have yet to come up with a complete
proposal.
the inline functions for easily retreiving the input data would be something
simmilar to those you proposed, except that there is not distinctions
between the devices, just the different types of controls (buttons and
axes). example:
int al_get_button(AL_INPUT_DEVICE *device, AL_CONTROLLER *control);
or
AL_INPUT *al_get_button(AL_INPUT_DEVICE *device, AL_CONTROLLER *control);
> I agree if we can handle statically linked version somehow.
Why do you think that will be a problem?
Sincerely Henrik Stokseth.
-----------------------------------------------------------------------
E-mail: hstokset@xxxxxxxxxx Homepage: http://hstokset.n3.net