comparison 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
comparison
equal deleted inserted replaced
85:60c7960354e0 86:13e4c612098d
53 53
54 #include "SDL_nullvideo.h" 54 #include "SDL_nullvideo.h"
55 #include "SDL_nullevents_c.h" 55 #include "SDL_nullevents_c.h"
56 #include "SDL_nullmouse_c.h" 56 #include "SDL_nullmouse_c.h"
57 57
58 #define DUMMYVID_DRIVER_NAME "dummy"
59
58 /* Initialization/Query functions */ 60 /* Initialization/Query functions */
59 static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat); 61 static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
60 static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); 62 static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
61 static SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); 63 static SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
62 static int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors); 64 static int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
74 76
75 /* DUMMY driver bootstrap functions */ 77 /* DUMMY driver bootstrap functions */
76 78
77 static int DUMMY_Available(void) 79 static int DUMMY_Available(void)
78 { 80 {
79 return 1; /* Always available ! */ 81 const char *envr = getenv("SDL_VIDEODRIVER");
82 if ((envr) && (strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
83 return(1);
84 }
85
86 return(0);
80 } 87 }
81 88
82 static void DUMMY_DeleteDevice(SDL_VideoDevice *device) 89 static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
83 { 90 {
84 free(device->hidden); 91 free(device->hidden);
134 141
135 return device; 142 return device;
136 } 143 }
137 144
138 VideoBootStrap DUMMY_bootstrap = { 145 VideoBootStrap DUMMY_bootstrap = {
139 "dummy", "SDL dummy video driver", 146 DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
140 DUMMY_Available, DUMMY_CreateDevice 147 DUMMY_Available, DUMMY_CreateDevice
141 }; 148 };
142 149
143 150
144 int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat) 151 int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat)