Null video driver patch

Hello, all.

I’ve put together an SDL video driver that effectively acts as a
collection of working stubs. This is to (ahem) fix a bug in Descent3,
where the dedicated server calls SDL_Init(SDL_INIT_VIDEO) when it doesn’t
need it (and where there’s not necessarily an X11 display available).

This can be useful in other situations; say, for example, a coder wants to
verify that whether a bottleneck exists in his code or SDL: just set
SDL_VIDEODRIVER=null and it’s immediately apparent whether a slowdown is
in the video driver or not.

More importantly, it allows an SDL porter to get the library up
piece-by-piece; start with the video driver, and use a null audio driver,
until you get around to implementing platform-specific code, etc.
(er…the null drivers for the rest of the system are forthcoming if this
is well-received).

Applications think that everything is copacetic with this code: it gives
them an offscreen framebuffer to scribble into, and blits to the "screen"
always pretend to be successful.

Rather than flood the list, the patch can be found at:

http://www.icculus.org/misc/SDL-1-2-null-video-RYAN-1.diff

Apply against SDL 1.2 cvs from this morning.

Comments and critiques welcome. Again, if this is generally useful, I’ll
supply null drivers for other systems.

–ryan. (@icculus)

Comments and critiques welcome. Again, if this is generally useful, I’ll
supply null drivers for other systems.

Good idea, I see no reason not to add this right away. Though I think
we could safely support more formats than 8bpp - in fact, any format
should be OK. Otherwise SDL will create a shadow surface and do expensive
converting each time you update the screen, and this is not what you want

Good idea, I see no reason not to add this right away. Though I think
we could safely support more formats than 8bpp - in fact, any format
should be OK. Otherwise SDL will create a shadow surface and do expensive
converting each time you update the screen, and this is not what you want

Yeah, I had noticed that after I sent the patch out. That’s what I get for
cut-and-pasting the AAlib driver! :slight_smile:

I’ll make an update later today.

–ryan.