在没有X-Window系统的情况下使用OpenGL [英] Using OpenGL Without X-Window System
问题描述
如何在没有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 =安装目录
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时要小心,以免覆盖系统的mesa库.
之后,使用以下选项编译您的应用程序:-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屋!