test/testvidinfo.c
branchSDL-1.3
changeset 1660 8b9d79e7eacf
parent 1545 8d9bb0cf2c2a
child 1662 782fd950bd46
--- a/test/testvidinfo.c	Wed May 17 08:18:28 2006 +0000
+++ b/test/testvidinfo.c	Sat May 20 04:35:58 2006 +0000
@@ -386,16 +386,32 @@
 int main(int argc, char *argv[])
 {
 	const SDL_VideoInfo *info;
-	int i;
+	int i, n;
 	SDL_Rect **modes;
-	char driver[128];
+	const char *driver;
+
+	/* Print available video drivers */
+	n = SDL_GetNumVideoDrivers();
+	if ( n == 0 ) {
+		printf("No built-in video drivers\n");
+	} else {
+		printf("Built-in video drivers:");
+		for ( i = 0; i < n; ++i ) {
+			if ( i > 0 ) {
+				printf(",");
+			}
+			printf(" %s", SDL_GetVideoDriver(i));
+		}
+		printf("\n");
+	}
 
 	if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
 		fprintf(stderr,
 			"Couldn't initialize SDL: %s\n", SDL_GetError());
 		exit(1);
 	}
-	if ( SDL_VideoDriverName(driver, sizeof(driver)) ) {
+	driver = SDL_GetCurrentVideoDriver();
+	if ( driver ) {
 		printf("Video driver: %s\n", driver);
 	}
 	info = SDL_GetVideoInfo();