GLFW and Mesa?

jose-damato wrote on Saturday, October 31, 2015:

Hello,

Please excuse my utmost ignorance: what is the link between glfw and mesa?

I am in the context of open source drivers (intel).

Will glfw ultimately use mesa?

Thanks,

Jose

Short answer is that if the computer you run a GLFW program on uses Mesa for OpenGL, then GLFW will use Mesa. So if you install the Mesa driver, and use GLFW, you’ll be using Mesa for OpenGL.

Mesa is an open-source implementation of the OpenGL specification for Linux, FreeBSD and other OSs.

GLFW is an Open Source, multi-platform library for creating windows with OpenGL contexts and receiving input and events. On Unix-like systems the X Window system (or Mir) is used for creating windows with OpenGL contexts.

The relationship is thus indirect, both Mesa and GLFW integrate with X Windows (or Mir), so when you ask for an OpenGL context and window with GLFW, X Windows may give you a Mesa OpenGL context if that’s the OpenGL implementation available. The actual context creation happens via GLX_ARB_create_context if available such as on implementations supporting OpenGL 3.2+, or glXCreateNewContext for prior OpenGL generations.