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

你。 提交于 2019-11-28 08:31:06

DirectFB has a X11 backend.

$ sudo apt-get install libdirectfb-extra  # for Debian and Ubuntu, anyhow
$ cat ~/.directfbrc
system=x11
force-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.

You could use Moblin Image Creator to create a disk image of Moblin, which you can then run inside a VM like QEMU. You can then test your DirectFB application inside the virtual machine.

You could develop (i.e. edit and compile) your application on your Ubuntu desktop, and test your application on the embedded platform that it is intended to run on.

If the embedded platform supports networking, you might be able to reduce the length of your edit-compile-test loop by running the application directly from an NFS share.

Here is a nice example with qemu and directFB:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!