SDl/SDL_mixer Graceful degradation (win32)

Hi,

Will SDL and SDL_mixer autmatically use GDI and WaveOut respectively
if DirectX is not present on a target system?

If not, How is such behaviour suitably implemented? Should one
try opening e.g. the audiodevice with environment variables indicating
directx and then upon failure change the variable to WavOut and try
again?

Thanks!

/Persson, K.

Persson, K. wrote:

Hi,

Will SDL and SDL_mixer autmatically use GDI and WaveOut respectively
if DirectX is not present on a target system?

SDL_mixer just uses SDL’s audio functions…so this is really a question about SDL.
SDL will rolloff starting with directmedia, then dx5, then dib(GDI).
of course you have to compile all of these into SDL for them to all be tried.
I don’t see how directX couldn’t be installed on a system these days.
Don’t forget that an SDL.dll will likely need all the DLLs just to let you
run your program anyway…

If not, How is such behaviour suitably implemented? Should one
try opening e.g. the audiodevice with environment variables indicating
directx and then upon failure change the variable to WavOut and try
again?

if it even loads, then the rolloff will occur automagically.
there seems to be no env vars that control which driver is used
at all for windows…

-LIM-

Will SDL and SDL_mixer autmatically use GDI and WaveOut respectively
if DirectX is not present on a target system?

It seems like it but I haven’t really gotten it to do so (I can’t test
for it – I can’t uninstall DirectX and I don’t really want to boot to
safe mode and mess up my system profile).

However your suggestion of changing the SDL_VIDEODRIVER and
SDL_AUDIODRIVER envvars to “windib” and “waveout” respectively will
work. Just in case, stdlib’s setenv function can let you set these
variables inside your program, just after your initial SDL
initialization code fails.–
Eric Vidal
Lecturer / Graduate Research Assistant, DISCS
Ateneo de Manila University
http://aegis.ateneo.net/evidal/

ah, SDL.c does use SDL_AUDIODRIVER env var
set to one of:
windib
dsound

for windows…

and “disk” for writing directly to a file.

-LIM-