How to choose videodrivers on windows

Hi:
Is this the best way to ask sdl to test first for directx, then
for the other available drivers? (I just know about windib)

#if defined(WIN32)
SDL_putenv(“SDL_VIDEODRIVER=directx”);
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE)!=0) {
SDL_putenv(“SDL_VIDEODRIVER=windib”);
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE)!=0) {
printf(“Could not initialize a video driver: %s\n”,SDL_GetError());
exit(1);
}
};
#else
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE)!=0) {
printf(“Could not initialize a video driver: %s\n”,SDL_GetError());
exit(1);
}
#endif //WIN32

 char drvname[30];
 drvname[0]='\0';
 SDL_VideoDriverName(drvname,30);
 printf("Using %s video driver\n",drvname);

Regards.----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Hi:

Hi, Facundo. How are you?

Is this the best way to ask sdl to test first for directx, then

for the other available drivers? (I just know about windib)

I think you shouldn’t mess with that, in case the user wants to override
it. What’s wrong with the default?

BrunoOn Mon, 02 Oct 2006 21:29:16 -0200, Facundo Dominguez - INCO wrote:

Hello Facundo,

Tuesday, October 3, 2006, 12:29:16 AM, you wrote:

Hi:
Is this the best way to ask sdl to test first for directx, then
for the other available drivers? (I just know about windib)

Use SDL_VideoInit() instead. There is only windib and directx.–
Best regards,
Peter mailto:@Peter_Mulholland

Is this the best way to ask sdl to test first for directx, then
for the other available drivers? (I just know about windib)

As far as I know, SDL will figure out what to use if DirectX fails (all
the way down to GDI) so this should be enough:

#ifdef WIN32
SDL_putenv(“SDL_VIDEODRIVER=directx”);
#endif

I don’t think you need to worry much about it. It’s doubtful that there
are any working Windows boxes these days that don’t have some version of
DirectX installed.