Question

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.

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?

Was it helpful?

Solution

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.

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.

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 :-)

OTHER TIPS

kmscube DRM example

It is possible, the most popular demo available is https://github.com/robclark/kmscube which uses OpenGL and EGL.

Unfortunately, the Ubuntu 18.04 package with NVIDIA proprietary drivers it does not work for me:

drmModeGetResources failed: Invalid argument
failed to initialize legacy DRM

bug report: https://github.com/robclark/kmscube/issues/12

But I did get it working on emulator.

It takes over the entire display, and shows a colorful spinning cube.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top