Get DirectFB 1.2.* running on Ubuntu 9.04 (with multi app support)

本文详细介绍了如何在Ubuntu 9.04上安装并配置DirectFB,包括设置帧缓冲区、编译DirectFB及其相关模块,并通过示例展示如何在X11环境下运行多应用程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

引用
http://blog.mageprojects.com/2009/05/12/get-directfb-12-running-on-ubuntu-904-with-multi-app-support/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Hi,

 

Since there is no guide anywhere on the internet that tells you how you can get DirectFB working on ubuntu, i will make one.

 

I expect you know how you compile things in this article. If you don’t follow some guide that explains how to do that.

 

The very first thing you have to do is get ubuntu (9.04 but the last few versions should all work fine).
next is setting up your “framebuffer” at boot time. To do this restart your pc. while in grub press “e” to edit that boot line. Then select the kernel line and again press “e” to edit that line. Now add (at the end of that line) vga=ask . Right after that it will ask you which resolution you want. See if yours is in that list and anter the number that’s standing infront of it. Now just let it boot. Once booted you will have to edit your grub menu file (sudo nano /boot/grub/menu.lst) and add vga=0xthe number you picked ) and then when you reboot you should have the framebuffer stuff. If you don’t have it look for a solution somewhere on the internet. Problems with framebuffers can be quite hard to understand or find solutions for. I don’t know much more about those framebuffers then this.

 

Once that’s all done you will have to setup your build environment. run the following commands:

 

sudo apt-get install linux-source // Will install the actual linux source of your current kernel
sudo apt-get build-dep linux // Will get your linux kernel source dependencies installed on your system
sudo apt-get build-dep libdirectfb-1.0-0 // We are going to use a later version of DirectFB but this will do fine to install the requirements
wget http://www.directfb.org/downloads/Core/DirectFB-1.2.8.tar.gz
wget http://www.directfb.org/downloads/Core/linux-fusion-8.1.1.tar.gz
wget http://www.directfb.org/downloads/Extras/DirectFB-examples-1.2.0.tar.gz

 

Note: go to: http://www.directfb.org/index.php?path=Main%2FDownloads to download the latest DirectFB 1.2.* (do not download the 1.3.* versions because that’s still in development) release and the latest linux-fusion file.

 

Once you’ve done the two apt-get lines and downloaded the files you will have to extract those later two.
Do that by running:

 

tar -xvf DirectFB-1.2.8.tar.gz
tar -xvf linux-fusion-8.1.1.tar.gz
tar -xvf DirectFB-Examples-1.2.0.tar.gz

 

The first thing we’re going to do now is getting that fusion module compiled and loaded at boot time.
Here is the list of commands to do that:

 

cd linux-fusion-8.1.1 make && sudo make install
sudo su -
echo fusion >> /etc/initramfs-tools/modules // this adds the text “fusion” at the end of the modules file
exit
sudo update-initramfs -u // This updates your initramfs file
sudo modprobe fusion // Only needed if you didn’t restart after you changed initramfs. Otherwise this module will be loaded anyway beacayse it’s done so during boot.

 

Now fusion is done.
Next is compiling DirectFB with multi application support.

 

Here is the list of commands needed for that:


cd DirectFB-1.2.8
./configure –enable-multi –libdir=/usr/lib64 –bindir=/usr/bin // note the libdir is /usr/lib64 for x86_64 distributions and just /usr/lib for the rest. Change it to your needs
make && sudo make install

 

Now it should be compiling for a few minutes. Depending on your cpu. My quadcore does this in a few minutes.
Once it’s done DirectFB is installed and (if all previous steps worked fine) can be used.

 

Now to see it in use we need some examples.
here is the command list for that:

 

cd DiirectFB-Examples-1.2.0
./configure –bindir=/usr/bin // note no need to set a libdir because it’s not making libs
make && sudo make install

Now the examples are also ready to use.
You can now switch to another tty (CTRL + ALT + F<number>), login and run something like df_window.
Be sure to type df_ followed by a hit on the tab button. It will give you all run commands that start with df_ and all the results that  you get to see are DirectFB examples.

 

But this didn’t show you a multi-app environment yet.

 

Log in into your gnome or kde or whatever graphical environment you use. Open up a terminal in there and type:

 

nano ~/.directfbrc

 

What we’re going to do now is change a few directfb settings to run it under X11. (see man directfbrc for more settings)
Just plain copy and paste the following settings in that file:

 

mode=1024×768
pixelformat=RGB32
system=x11

 

You can change the resolution to your

liking if you want.

 

Now type (still in that same console that’s running inside your graphical environment):

 

df_window & // runs it in the background
df_cpuload &

 

And you will see the df_window example with in there the cpuload graphic. Nifty huh?
Just be carefull here. save all your data before you start with this because if you do anything wrong it COULD completely crash your system in a way that you just have to reboot to get it back. While writing this howto i experienced this myself because i did do df_window & but i didn’t add the “&” to df_cpuload

 

This was it for the DirectFB howto.
I might post more stuff about DirectFB in the future.

 

I hope it was useful to you,
Mark

 

一、综合实战—使用极轴追踪方式绘制信号灯 实战目标:利用对象捕捉追踪和极轴追踪功能创建信号灯图形 技术要点:结合两种追踪方式实现精确绘图,适用于工程制图中需要精确定位的场景 1. 切换至AutoCAD 操作步骤: 启动AutoCAD 2016软件 打开随书光盘中的素材文件 确认工作空间为"草图与注释"模式 2. 绘图设置 1)草图设置对话框 打开方式:通过"工具→绘图设置"菜单命令 功能定位:该对话框包含捕捉、追踪等核心绘图辅助功能设置 2)对象捕捉设置 关键配置: 启用对象捕捉(F3快捷键) 启用对象捕捉追踪(F11快捷键) 勾选端点、中心、圆心、象限点等常用捕捉模式 追踪原理:命令执行时悬停光标可显示追踪矢量,再次悬停可停止追踪 3)极轴追踪设置 参数设置: 启用极轴追踪功能 设置角度增量为45度 确认后退出对话框 3. 绘制信号灯 1)绘制圆形 执行命令:"绘图→圆→圆心、半径"命令 绘制过程: 使用对象捕捉追踪定位矩形中心作为圆心 输入半径值30并按Enter确认 通过象限点捕捉确保圆形位置准确 2)绘制直线 操作要点: 选择"绘图→直线"命令 捕捉矩形上边中点作为起点 捕捉圆的上象限点作为终点 按Enter结束当前直线命令 重复技巧: 按Enter可重复最近使用的直线命令 通过圆心捕捉和极轴追踪绘制放射状直线 最终形成完整的信号灯指示图案 3)完成绘制 验证要点: 检查所有直线是否准确连接圆心和象限点 确认极轴追踪的45度增量是否体现 保存绘图文件(快捷键Ctrl+S)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值