Answer the question
In order to leave comments, you need to log in
How to run an application with OpenGL from command line without running x server?
Hello!
There is one project where I want to try using raspberry.
raspberry will display data from some physical sensors.
That is, I want to draw some graphics on the display based on sensor data.
At once I will make a reservation that never worked in linux.
The command line and linux itself are still wild for me, but this does not stop me, I study everything that is necessary for the implementation of my project. :)
As I see it for myself, for speed and the fastest launch (which is critical for me), use the bare operating system as much as possible, so that at the time of launching rassbery, the application I wrote is launched. Accordingly, loading the shell is initially long and not desirable.
You need to load the command line. And from it to launch my application with graphics.
How I tried.
While there is no confusion on hand, I installed ubntu on the virtual machine.
Wrote a simple program that draws a triangle using OpenGL(MESA).
Compiled, launched in a shell, everything is ok. Drawn.
I disabled the graphical shell and the program cannot start, swearing "failed to open display 0.0".
But in principle it is understandable, the x server is stopped.
glxinfo also swears at display 0.0
That is, xserver still needs to be started, but how to start xserver so that the shell does not start loading, as it happens with me?
Although maybe I initially chose the wrong path for implementation?
Advise how to finish my way or advise another way that will work.
If I'm talking nonsense, then I'm sorry))
You need to get something similar on the screen, but of course I want to use more advanced graphics
Answer the question
In order to leave comments, you need to log in
Well, output using the CLI.
If you need at least some graphics, use ncurses.
everything is quite natural.
your program is designed to display an object in a graphical interface.
if there is no graphical interface, then it does not know where to display the object, and it justifiably crashes with the output error that you see.
until you explain what you mean by "I want to draw some graphics on the display" with the graphical shell turned off, which actually draws the graphics, no further progress will be made.
to learn how to work with the x-server, you need to read what STE is and how it works. direct question - what did you read??
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question