Re: [AD] get_volume()

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


> I think, we should just add a function like this:
>
> AL_DRIVER_INFO *al_get_driver_info(driver), where driver can be:
>
> AL_SYSTEM_DRIVER
> AL_GFX_DRIVER
> AL_DIGI_DRIVER
> AL_JOYSTICK_DRIVER
> AL_TIMER_DRIVER
> AL_MIDI_DRIVER
> and so on..
>
> And struct AL_DRIVER_INFO
> {
>     AL_ID id;
>     char const *name;
>     char const *description;
>     possibly more info?
> }
>
> That way, we need no separate is_gfx_driver_installed and
> get_gfx_driver_id functions, which, when done for all drivers, would
> clutter the API quite a bit.

I agree. A way to query Allegro's driver system is currently lacking and
would be quite useful for addons. As I recall, the original idea for
Allegro5 was to use the config file routines for this, with an API that
allowed things like al_get_config_string("allegro/driver/gfx/name"). If
that's still the plan, then I think someone should probably add it to the
4.3 API branch, although I'm not sure that there was agreement on the
design.

While we're on the subject, it would also be nice if there were a way to
register a driver type for use with Allegro at runtime, something like
al_register_driver(AL_GFX_DRIVER, fancy_gfx_driver_vtable), such that the
driver could be detected using the AUTODETECT driver.

I guess that puts us beyond 4.2 country, but I'd love to have something
like that in 4.3. The al_get_driver_info idea would be ok for 4.2 if
someone can get it done.

Maybe it's best to stick with a simple function for each subsystem that
checks if it has been initialized (rather than checking the global pointer
against NULL in user code) and getters to acompany some setters in the API
to make it more symmetric (such as the get_volume() this thread started
with) for the 4.2 release and implement the more general/useful
functionality directly into 4.3.

Evert




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