在Linux中如何在没有窗口管理器的情况下使用OpenGL? [英] How to use OpenGL without a window manager in Linux?

查看:472
本文介绍了在Linux中如何在没有窗口管理器的情况下使用OpenGL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚读完LFS书,并且我的Linux系统现在正在运行.我想使用OpenGL在屏幕上显示图形,而现在唯一安装的软件包是 http://www.linuxfromscratch.org/lfs/view/stable/chapter03/packages.html .

I've just finished the LFS book and my Linux system is working right now. I want to use OpenGL to display graphics on the screen, while the only installed package right now are those described on http://www.linuxfromscratch.org/lfs/view/stable/chapter03/packages.html.

我不想安装Gnome,KDE或X.org之类的东西.相反,我想直接从我的软件中使用OpenGL.这可能吗,我该怎么做?还是像编写一个全屏运行的OpenGL应用程序一样容易(我不这么认为:'p)?

I don't want to install something like Gnome, KDE or X.org. Instead, I want to use OpenGL directly from my software. Is this possible, and how can I do this? Or is it just as easy (I don't think so :'p) as writing an OpenGL application which runs full screen?

推荐答案

您不必安装Gnome或KDE.这些用于托管窗口,您可以在没有窗口管理器的情况下启动图形应用程序.

You don't have to install Gnome or KDE. These are used to managed windows, and you can launch graphical applications without having a window manager.

因此,您必须安装X服务器. X服务器负责在屏幕上绘制内容.没有X服务器,您将无法启动图形应用程序.

Therefore, you'll have to install a X server. The X server is responsible of drawing things on your screen. Without X server, you can't launch graphical applications.

一旦安装了X,启动它,导出您的DISPLAY环境变量,其余的就像编写一个运行全屏的OpenGL应用程序:-)

Once X has been installed, launch it, export your DISPLAY environment variable, and the rest is like writing an OpenGL application which runs full screen :-)

这篇关于在Linux中如何在没有窗口管理器的情况下使用OpenGL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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