Re: [AD] about driver lists

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


Peter Wang wrote:
When al_num_joysticks() is called, there may not be a joystick driver installed. So do I find a working joystick driver, initialise it, ask it the number of joysticks on the system, then shut down the driver again?

I wouldn't. What I would do is either return 0 (no joysticks detected since no driver is installed) or -1 (no driver installed).

More background: joysticks are to be (un)installed using the functions:

   AL_JOYSTICK *al_install_joystick(int joystick_number);
   void al_uninstall_joystick(AL_JOYSTICK *js);

Right now I'm planning for the joystick driver to be initialised when the first joystick is installed, and shut down when the last joystick is uninstalled.

I personally would prefer explicit init/deinit functions (in case you want to pass options to Allegro's driver or something), though if you're not going to do that I suppose what you have is good.

BTW, what advantages does the normal Win32 joystick driver have over the DirectX joystick driver?

I would think the DirectX driver has more direct access to the hardware (which means it'd be faster) and is much more recent. Kinda like the difference between WaveOut and DirectSound.

- Kitty Cat




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