[SDL] Hide ouput of the SDL_SetVideoMode

Ryan C. Gordon icculus at icculus.org
Tue Jul 4 10:22:21 PDT 2006


> What is the Dummy Video driver?.

It's a SDL video target that does nothing. SDL_SetVideoMode() will claim 
to succeed, and it'll supply you with a memory buffer that is supposed 
to be the screen surface, but it doesn't ever create a window, etc. It 
has no platform-specific dependencies, since all it does is allocate a 
memory buffer and not much else.

It's partially meant for bootstrapping SDL on a new platform (you can 
just use the dummy video driver so you know the library is working 
before implementing any platform-specific code), but it's also handy for 
unusual cases like this wxWidgets thing we were discussing (using video 
functions, but not using SDL to render to the screen), or benchmarking 
your program, in cases when you care about your code's performance and 
not the screen blit overhead. It's 2D only, and thus can't be used with 
OpenGL.

There is also a dummy audio target, which is good for the same reasons, 
and also for games where the developer didn't supply a means to turn off 
the sound output.

You can explicitly choose the dummy drivers, if they were compiled in, 
with an environment variable:

  in bash:
   SDL_VIDEODRIVER=dummy ./mygame

  in Windows:
   set SDL_VIDEODRIVER=dummy
   mygame.exe

  (or you can use SDL_putenv() in your app.)


We'll have a real mechanism for selecting drivers that doesn't use 
environment variables in SDL 1.3.

--ryan.





More information about the SDL mailing list