如何在不离开 X.11 环境的情况下开发 DirectFB 应用程序

发布于 2024-07-13 11:13:49 字数 296 浏览 10 评论 0原文

我正在尝试为嵌入式平台开发一个 GUI 应用程序,没有任何窗口,我正在使用 DirectFB 来实现这一点,它非常适合我的需求。

由于我开发的嵌入式功能不是那么强大,所以我很想尝试在自己的Ubuntu桌面上进行开发。 问题是 Framebuffer 与 X.org 冲突,导致我离开整个桌面,并关闭 X.org 只是为了查看更改的结果。

有适合我需要的良好帧缓冲区模拟器吗? Qt 有一个叫做 QVFb,但它只适用于开发 Qt 应用程序,而且 DirectFB 的 VNC 后端总是崩溃。

那么,有什么想法吗?

I'm trying to develop a GUI application for an embedded platform, without any windowing whatsoever and I'm doing that with DirectFB, and it suits my needs very fine.

Since the embedded I develop for is not that powerful, I would really like to try to develop on my own Ubuntu desktop. The problem is Framebuffer is conflicting with X.org causing me to leave the whole desktop, and shutdown X.org just to see the result of my changes.

Is there a good framebuffer simulator that suits my needs? Qt has one, called QVFb, but it only works for developing Qt apps, and the VNC back-end of DirectFB always crash.

So, any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

那一片橙海, 2024-07-20 11:13:50

DirectFB 有一个 X11 后端。

$ sudo apt-get install libdirectfb-extra  # for Debian and Ubuntu, anyhow
$ cat ~/.directfbrc
system=x11
force-windowed

此外,DirectFB 有一个 SDL 后端,而 SDL 有一个 X11 后端。 此外,SDL 有一个 GGI 后端,GGI 有一个 X 后端。 这有点迂回,但它应该可以工作:)

我对其进行了测试,

$ SDL_VIDEODRIVER=directfb ffplay some_movie.avi

并得到了一个漂亮的 640x480 窗口,其中包含媒体播放和 DirectFB 处理分层和输入,所以我确信这可以工作。

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.

浅浅 2024-07-20 11:13:50

前面三个答案都是很好的建议。 我建议尝试 ephemient 的答案,因为它是最简单的。 有关设置 .directfbrc 文件的更多详细信息,请查看“man directfbrc”。

另一种可能性是从 X 切换到另一个虚拟终端(使用 CTRL+ALT+F1),运行 directfb 程序,然后切换回 X(使用 CTRL+ALT+F7)。

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).

她比我温柔 2024-07-20 11:13:50

我开始使用ephemient的解决方案在chroot环境中运行DirectFB应用程序(目标文件系统由buildroot提供)除了 Xnest 之外,它是一个在当前 X 的窗口中运行的单独的 X 环境。

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

这样您不仅可以确保 directfb 安装正确,而且所有必需的依赖项都安装在 chroot 文件系统内。

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.

哎呦我呸! 2024-07-20 11:13:50

您可以使用 Moblin Image Creator 创建 Moblin 的磁盘映像,您可以使用然后可以在 VM 中运行,例如 QEMU。 然后,您可以在虚拟机内测试 DirectFB 应用程序。

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.

猫九 2024-07-20 11:13:50

您可以在 Ubuntu 桌面上开发(即编辑和编译)您的应用程序,并在要运行的嵌入式平台上测试您的应用程序。

如果嵌入式平台支持网络,您可以通过直接从 NFS 共享运行应用程序来缩短编辑-编译-测试循环的长度。

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.

半步萧音过轻尘 2024-07-20 11:13:50

这是一个使用 qemu 和 directFB 的很好的例子:

Here is a nice example with qemu and directFB:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文