Hi everyone!
I’m wondering what would be the best approach to code, say a trivial game, on Linux/BSD without relying on the X11 Windowing System?
Suppose I don’t want an X11 window, I will have my application take over the screen.
From what I’ve understood, the way things work now, is as such:
- I write code that uses some OpenGL functions.
- Thus, I need to include opengl headers
- I include the headers and now I want to compile my program.
- So then there must be a library that provides GL.h. I believe a popular choice would be Mesa 3D.
- I compile my program and link against Mesa3D.
- I run the program.
And point 6 is where I am a bit stuck. Will Mesa allow access to the graphics hardware? Does Mesa know about the hardware at all, or is it relying on some other library to deal with that, like for example DRI?
So far I’m thinking DRI takes care of the hardware and Mesa takes care of OpenGL. But how do they work together?
And is DRI usable without an X11 server?
What about SDL? Is it a replacement for Mesa 3D or DRI? Or is SDL using/can use Mesa to do its drawing?
I guess I need a brief explanation about what libraries to use in order to be able to draw graphics without X11.
This whole Mesa/DRI/SDL(?) seems complicated and overwhelming, because all I want is to run an application that will draw something on the screen.
I still remember the good old Pascal/C days where I would specify #include <graphics.h> or ‘uses graph;’ and then call initgraph() to initialize the graphics. And then I could draw on that screen to my heart’s content.
I am of course looking to use 3D acceleration and OpenGL, and if I could get (roughly) the same simplicity and low-level access, I’ll be more than happy.
If you have any suggestions or corrections to the way I’m looking at things, please do reply. Any links and explanations will be appreciated!
Thanks!
P.S.: Where does the NVidia / ATI driver fit? Are they dependant on the X Server? Does NVidia supply any header files for us to use their driver?