在没有 X-Window 系统的情况下使用 OpenGL

发布于 2024-09-05 12:57:59 字数 179 浏览 2 评论 0原文

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

有一个名为 DirectFB(直接帧缓冲区)的项目。使用 DirectFB 我们可以做到这一点,但 DirectFB 需要每个硬件的驱动程序,而我想使用只有 Linux 驱动程序的显卡。

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

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.

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

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

发布评论

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

评论(5

凉风有信 2024-09-12 12:57:59

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

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 存储库中不可用(旧版本可用),因此您必须下载源代码并使用以下命令:

./configure
make
make install

3-下载 mesa 库,然后使用以下命令编译它:
./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'

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- 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-Download mesa library and then compile it using the following commands:
./configure --prefix=install_directory

make realclean
make linux-fbdev
sudo make install

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'

一萌ing 2024-09-12 12:57:59

显然,SDL 可以在没有 X 的情况下运行。

基本上,您的内核应该具有帧缓冲区支持,并且您可以在 DirectFB 之上使用 SDL。

这些线程没问题:

http://lists.libsdl。 org/pipermail/sdl-libsdl.org/2006-October/058305.html

http://forums.libsdl.org/viewtopic.php?t=4079

Apparently is possible to have SDL running without X.

Basically, your kernel should have framebuffer support and you could use SDL on top of DirectFB.

These threads are ok:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2006-October/058305.html

http://forums.libsdl.org/viewtopic.php?t=4079

晨敛清荷 2024-09-12 12:57:59

正如你所说,你需要一个驱动程序来做到这一点。 99.9% 的 Linux 图形驱动程序都使用 X11,因此除非您的硬件有 DirectFB OpenGL 驱动程序,否则您将不得不使用 X11。

As you said, you need a driver to do this. 99.9% of all Linux graphics drivers use X11, so unless you have a DirectFB OpenGL driver for your hardware, you are stuck with using X11.

跨年 2024-09-12 12:57:59

我在 Linux 中使用 SDL(简单直接媒体层)进行 OpenGL 编程。这个网站有一些很好的教程可以帮助您进行设置。使用 SDL 的优点之一是它可以跨平台移植,因此一旦您在 Linux 上运行某些东西,只要您安装了 SDL,它就会直接转移到 Windows 上。

I use the SDL (Simple Direct Media Layer) for OpenGL programming in Linux. This site has some nice tutorials to get you set up. One advantage of using SDL is that it will port across platforms, so once you get something running on Linux, it'll transfer right over to Windows so long as you have SDL installed there.

小嗷兮 2024-09-12 12:57:59

您可以使用 Mesa 进行基于帧缓冲区的软件渲染。

You can use Mesa for framebuffer-based software rendering.

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