[SDL] SDL and the framebuffer

David Olofson david at olofson.net
Wed Jan 26 04:51:07 PST 2005

On Wednesday 26 January 2005 13.24, Steve B wrote:
> --- David Olofson <david at olofson.net> wrote:
> On Wednesday 26 January 2005 12.35, Steve B wrote:
> > Is SDL capable of using the framebuffer?
> Yep, and DirectFB as well. (And IIRC, GGI, which also supports
> fbdev - but there's no point in adding another layer, of course.)
> --
> Ok, but how do I tell SDL what video backend to use?

When you initialize the display, SDL will try to use the "best" 
backend it has compiled-in support for. You can override that 
mechanism using the SDL_VIDEODRIVER system variable;

 SDL_VIDEODRIVER=directfb ./your_application

 export SDL_VIDEODRIVER=directfb

> I don't think there's a need for an example, since fbdev is just
> another supported backend.
> --
> again.. how do I specefiy what backend to use when compiling
> individual applications..

You don't. :-) (Unless the *application* can select backends 
explicitly, and has a compile time option to require a specific 

> there has to be a way to say compile this 
> app to run under X and this one to run under fb..

You don't compile any actual SDL code when you compile SDL 
applications, not ever when linking statically with SDL, so the only 
way to affect the operation of SDL is through the application code, 
when it's executed.

> or will an 
> application compiled under sdl just use the fb is X is not running?

Yep. Any application using SDL should run on any backend, or at least 
backends that provide the required features, if there are any special 
requirements. (A mouse or OpenGL may be required for the application 
to be of any use, for example. Some applications may be "hardwired" 
to specific backends as a result of bypassing SDL for certain 

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list