How rendering with opengl works
I have some difficulties understanding how rendering works on linux, so let's assume that I use nvidia's opengl implementation and driver.
Now if I write an opengl program, I assume it goes something like this:
1: My program calls opengl functions in libGL.so
2: libGL.so uses the nvidia driver to draw to the screen.
^ Is that correct so far? If it is, I don't see X11's role in this, but for some reason opengl needs X to work.
So could someone explain X's role in this process?
Why can't I draw directly to the screen without the use of X11?
And if opengl needs X11, how does X11 draw to the screen?
I already tried googling but none of the sites explain my question.
I'd like to have some flow chart on what depends on what and who calls who, etc...
-- Thanks to anyone who want's to help me on this ;)