在没有 X-Window 系统的情况下使用 OpenGL [英] Using OpenGL Without X-Window System

查看:20
本文介绍了在没有 X-Window 系统的情况下使用 OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在没有 X-Window 系统的 Linux 平台上使用 OpenGL,我可以将 OpenGL 图形直接发送到帧缓冲设备吗?

How to OpenGL on Linux Platform Without X-Window System, can I send OpenGL Graphics Directly to Framebuffer Device?

有一个名为 DirectFB (Direct FrameBuffer) 的项目.使用 DirectFB 我们可以做到这一点,但 DirectFB 需要每个硬件的驱动程序,我想使用只有 Linux 驱动程序的显卡.

There Is Project Named DirectFB (Direct FrameBuffer). With DirectFB We can do this but DirectFB needs for driver for each hardware and I want to user a graphic card that only have Linux driver.

推荐答案

这是我在 ubuntu 11.04 中详细做的:1- 使用以下命令安装依赖项:

This is how i did it in my ubuntu 11.04 in detail: 1- Install the dependencies using the command:

sudo apt-get install xutils-dev libpciaccess-dev x11proto-dri2-dev x11proto-gl-dev libxdamage-dev libxfixes-dev

2- mesa 库需要 libdrm 版本 >= 2.4.24,这在 ubuntu 11.04 存储库中不可用(旧版本可用),因此您必须下载源代码并使用以下命令构建它:

2- The mesa library needs libdrm version >= 2.4.24 which is not available in the ubuntu 11.04 repository (older version is available) so you have to download the source and build it using the following commands:

./configure
make
make install

3-下载 mesa 库,然后使用以下命令编译它:./configure --prefix=install_directory

3-Download mesa library and then compile it using the following commands: ./configure --prefix=install_directory

make realclean
make linux-fbdev
sudo make install

选择 install_directory 时要小心,以免覆盖系统的台面库.之后使用以下选项编译您的应用程序:-lGL -lOSMesa -ldl -L'install_directory/lib' -I'install_directory/include'

be careful when you choose the install_directory so that you don't overwrite the system's mesa library. after that compile your application using the options : -lGL -lOSMesa -ldl -L'install_directory/lib' -I'install_directory/include'

这篇关于在没有 X-Window 系统的情况下使用 OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆