How to develop a DirectFB app without leaving X.11 environment How to develop a DirectFB app without leaving X.11 environment linux linux

How to develop a DirectFB app without leaving X.11 environment


DirectFB has a X11 backend.

$ sudo apt-get install libdirectfb-extra  # for Debian and Ubuntu, anyhow$ cat ~/.directfbrcsystem=x11force-windowed

Also, DirectFB has a SDL backend, and SDL has a X11 backend. Also, SDL has a GGI backend, and GGI has an X backend. That's a bit circuitous, but it should work :)

I tested it with

$ SDL_VIDEODRIVER=directfb ffplay some_movie.avi

and got a nice 640x480 window with media playing and DirectFB handling layering and input, so I'm sure this works.


The three previous answers are all good suggestions. I'd suggest trying ephemient's answer because it's the simplest. For more details on setting up your .directfbrc file, check out "man directfbrc".

One other possibility would be to switch from X to another virtual terminal (using CTRL+ALT+F1), run your directfb program, and then switch back X (using CTRL+ALT+F7).


I came to use ephemient's solution to run DirectFB applications inside a chroot environment (target filesystem as a courtesy of buildroot) in addition to Xnest, a separate X environment which runs in a window of the current X.

$ Xnest -ac :1 &$ cd $TARGET_DIR # into the target file system root$ DISPLAY=:1 sudo chroot . usr/bin/df_neo

This way you can assure not only your directfb installation is correct, but also all the required dependencies are installed inside the chroot'ed file system.