[SDL] CVS Update (driverlist + aRts + 1.1.7 prerelease)
Mattias Engdegård
f91-men at nada.kth.se
Tue Dec 12 16:30:15 PST 2000
>And I've finally added API calls to list the available audio and
>video drivers, along with a test program 'listdrivers' that will
>show you the drivers available to SDL. Note that these functions
>return the drivers that will actually be used in initialization,
>not just the ones that are compiled in.
Please don't cast that API in stone. There are reasons to prefer a
more flexible interface. The form (FirstVideoDriver, NextVideoDriver)
isn't very nice since it maintains a hidden state. Better solutions
would be to provide a callback enumeration on the form
EnumerateVideoDriver(void (*f)(something *, void *), void *)
or even simpler, just return a vector of the drivers to the user.
Orthogonally it would be nice to get driver capabilities, not just a
string (which is only good for user choices). A game would pick a driver
with the capabilities it needs, or offer hints to the user for driver
choice. Example:
SDL_DriverInfo **SDL_GetVideoDriverList(int kind)
returning a vector of pointers to structs
struct SDL_VideoDriverInfo {
char *name, *description;
int version;
SDL_VideoInfo *vinfo;
};
perhaps augmented with more information. Care should be taken to arrange
the structs in a way so that we can add capabilites without breaking
binary compatibility
More information about the SDL
mailing list