Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I see that modern OpenGL related code uses EGL, i can't get good resources for this so i ask here:

  • what exactly is EGL ?
  • if a platform supports OpenGL ES 2.0+ or OpenGL 3.0+ i can presume that will support EGL too ?
  • when is convenient to use EGL and when it's not?

for what i can tell by now it's something similar to FreeGLUT to me, but looks much more portable and standardized.

share|improve this question
"I see that modern OpenGL related code uses EGL" No, it does not. EGL is not widely implemented on desktop platforms, and it's not implemented on iOS. – Nicol Bolas Sep 21 '12 at 19:23

CAVEAT: This is from the perspective of desktop OpenGL development; things may be different on mobile platforms.

EGL is Khronos's attempt to create a unified official cross-platform standard to replace (or at least abstract around) the platform-specific windowing/context-creation APIs like Windows's WGL, Unix's GLX, and Apple's Core GL. It sounds great in theory, but in practice it isn't very widely supported yet. It's certainly not a requirement that modern OpenGL programs use EGL.

Right now, EGL is really only relevant if you're using multiple Khronos graphics APIs in the same application, and want them to share a window / rendering context. If you're not using OpenGL, OpenGL ES, OpenMAX|AL, and/or OpenVG simultaneously, EGL probably won't provide you any benefits over an existing cross-platform OpenGL-only windowing system like FreeGLUT/SDL/GLFW/etc.

share|improve this answer
I generally find EGL in applications that are "OpenGL only" i don't see any real problem with that, can you explain why is good to use EGL only with more than 1 technology ? – user827992 Sep 13 '12 at 13:37
EGL is being pushed as the replacement for the OS-specific APIs. GLES devices essentially require EGL. Linux is slowly moving towards mandatory EGL and the removal of GLX. The IHVs are also pushing EGL and starting to suggest that developers use it on Windows. I'm unsure what the status or recommended practice for EGL usage is on OSX. – Sean Middleditch Sep 13 '12 at 23:21
@SeanMiddleditch: Do you have any evidence of EGL being pushed on Linux? I wasn't aware that EGL was even available on Linux platforms. Do non-open source drivers support it? – Nicol Bolas Sep 21 '12 at 19:24
EGL is available in Mesa, is the only context creation API for Wayland which is being backed as the X11 replacement (by many X11 core devs), and NVIDIA just pushed a proposal to standardize on EGL as the system context creation API at XDC2012. You can check the Mesa, DRI, and Xorg mailing lists for some of the recent discussions, as well as check the git repos. – Sean Middleditch Sep 21 '12 at 21:30
  • what exactly is EGL ?

Like postgoodism's answer states, it's Khronos api that basically does the same thing as WGL, GLX, and other platform-specific "gl bootstrapping" libraries do. It also provides some cross-api functionality, like using OpenCL with OpenGL while sharing some resources. In theory, at least. =)

  • if a platform supports OpenGL ES 2.0+ or OpenGL 3.0+ i can presume that will support EGL too ?

No. Desktop OpenGL doesn't need EGL. Practically all mobile devices that support OpenGL ES are based on EGL, though (I haven't seen a single one where this isn't the case, but then again, I haven't played with iOS devices for example, so I may be wrong).

  • when is convenient to use EGL and when it's not?

It's convenient when you're not using some higher-level bootstrapping library like SDL or GLFW, and EGL is available. On the other hand, platform-specific library example code is probably more easily available. YMMV.

share|improve this answer

Well, EGL is supposed to be an API that abstracts the platform specific stuff like window creation and context creation. But it fails miserably - it simply lacks the necessary functions for trivial window management primitives. You still have to create windows with platform specific code (eg. X11 or GBM) and then pass it as a void* pointer. Oh, and you'll have to load the correct backend library, otherwise booom-bang.

Bottom line: pretty useless. Much worse than GLUT (which, on the other hand, doesn't support direct fs w/o window system). And the API design is really horrible. Broken by design.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.