Search code examples
macosopenglhomebrewdylibegl

How can I install libEGL.dylib on MacOS?


I'm trying to use EGL via LWJGL on MacOS to use offscreen rendering. It seems to throw an exception of the missing library libEGL.dylib.

I couldn't find this library on package distribution service like brew. However, I could find several minor repositories on Github containing libEGL.dylib. I don't think this is safe to use.

How can I find the binary officially, or find the source to build?


Solution

  • There isn't any canonical libEGL implementation. The header files are part of the standard, but the implementation isn't.

    MoltenGL has a binary download available (the second one, "OpenGL ES 2 for macOS").

    If you prefer an open-source implementation, Google's ANGLE also implements EGL and supposedly supports macOS. And for what it's worth, it appears that Apple is using this in WebKit for iOS as well.