diff src/video/dummy/SDL_nullvideo.c @ 86:13e4c612098d

Dummy audio and video drivers are enabled (thanks Ryan!)
author Sam Lantinga <slouken@lokigames.com>
date Mon, 02 Jul 2001 00:20:29 +0000
parents cf2af46e9e2a
children a90b13a831cf
line wrap: on
line diff
--- a/src/video/dummy/SDL_nullvideo.c	Mon Jul 02 00:10:19 2001 +0000
+++ b/src/video/dummy/SDL_nullvideo.c	Mon Jul 02 00:20:29 2001 +0000
@@ -55,6 +55,8 @@
 #include "SDL_nullevents_c.h"
 #include "SDL_nullmouse_c.h"
 
+#define DUMMYVID_DRIVER_NAME "dummy"
+
 /* Initialization/Query functions */
 static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
 static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
@@ -76,7 +78,12 @@
 
 static int DUMMY_Available(void)
 {
-	return 1; /* Always available ! */
+	const char *envr = getenv("SDL_VIDEODRIVER");
+	if ((envr) && (strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
+		return(1);
+	}
+
+	return(0);
 }
 
 static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
@@ -136,7 +143,7 @@
 }
 
 VideoBootStrap DUMMY_bootstrap = {
-	"dummy", "SDL dummy video driver",
+	DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
 	DUMMY_Available, DUMMY_CreateDevice
 };