> Peter Wang wrote:
> I wouldn't say broken.. more like convoluted and confusing. What I
> have a problem with is the axis stuff.. I mean, you have no idea where
> the stick/axis's are on the joystick, so its near impossible to just
> throw joystick support in. You have to provide manual configuration in
> case the user's joystick doesn't match what the game expects.
Ah, right, I forgot about that. We either need an
al_joystick_stick_type() function, or more AL_JOYFLAG_* flags (like
AL_JOYFLAG_DPAD, AL_JOYFLAG_HAT, etc.)
BUT, you can't get any of this information in linux, so you'd *still*
need to provide configuration screens. It could help with picking
default controls though.
> Now, if we could map axis's to seperate analog buttons, that would be
> cool. Because them all you have to do is specify different button
> placements. Much easier than having to worry about stick/button
> placement and useage.
It sounds a bit... weird. Care to elaborate?
> I prefer having explicit install functions in case you want to
> introduce pre-installation options. Though I personally think the
> *_driver bit is too much.. al_install_joystick is good.
>> Yeah, I'm not sure. But all the other al_install_*() functions look
>> like they will be returning objects, like:
>> AL_TIMER *al_install_timer();
>> AL_KEYBOARD *al_install_keyboard();
> Well, the timer is a different type of object. It's not an input
> object so it's behavior should be allowed to be slightly different.
> Though with the input objects, perhaps they could return the
> first/only device of that type? So
> x = al_install_keyboard();
> would be equivilant to
> x = al_get_keyboard(0);
There's not going to be multiple keyboards, so it was always going to be
just "kbd = al_install_keyboard();"
I'm not sure about mice yet. My last proposal lumped mice and tablets
together into "pointers" (like X does), but I'm not sure it's a good
idea. For one, the driver that handles mice would probably be rather
different to one that handles tablets. Further, there could be multiple
tablet drivers available.
> I'm not sure I like "request" either. When you request something (like
> request_video_bitmap), the program returns ASAP and does whatever in
> the background. What about "get"?
I hadn't thought of request_video_bitmap.
'get' is fine. I just wasn't sure about 'unget', although libc has been
using it for years so we can probably consider it a word :-)
> What about al_get_joystick? It gets a handle to the joystick number
> you pass (if available). The handle is then destroyed with the driver,
> so the handles you got just become invalid. I think that works..
Yup, handles are destroyed with the driver.