OpenGL-based programs must link with the libGL
library. libGL
implements the GLX interface as well as the main OpenGL API entrypoints. When using indirect rendering, libGL
creates GLX protocol messages and sends them to the X server via a socket. When using direct rendering, libGL
loads the appropriate 3D DRI driver then dispatches OpenGL library calls directly to that driver.
Refer to: http://dri.sourceforge.net/doc/DRIintro.html for more details.