6

Recently I am working with bigflake.com CameraToMpeg example where we can see how to make use of OpenGLES. One of the last steps is to initialize EGL14 to record the current OPNEGLES context and swap it to MediaCodec.

My question is however: What is exactly EGL14? Why EGL14 is a mechanism for creating surfaces onto which OPENGLES can render, since when in a simple OPENGLES I never initialize EGL14? Is it an additional class, or indispensable for OPENGLES operations? How does EGL know what is the current OPENGLES context? What else can I do with that, for example am I able to make a context with a concrete texture in OPENGLES? Where to find some more documentation about it - books?

  • Tell me about it! "EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system" What does this mean? Why EGL14 is a mechanism for creating surfaces onto which OPENGLES can render, since when in a simple OPENGLES I never initialize EGL14? Where to find some more documentation about it - books? How does EGL know what is the current OPENGLES context? What else can I do with that, for example am I able to make a context with a concrete texture in OPENGLES? find me one person who works with EGL overview run by Khronos or the like – KOalaDelYtaPLaYa Dec 21 '19 at 10:52
  • are u kidding? who said it? just answer the above questions – KOalaDelYtaPLaYa Dec 21 '19 at 11:14
  • 1
    nice, now it looks like I am doing a conversation with myself – KOalaDelYtaPLaYa Dec 21 '19 at 11:48
  • can you answer some questions for me? thanks – Uriel Frankel Dec 15 '22 at 07:54

1 Answers1

7

The OpenGL, or OpenGL ES - is everything about rendering within some environment. It doesn't know or care about what exactly that environment is. As long as it provides required list of compliant functions that can be called to achieve desired result - that's OpenGL for you.

Now how do you create that environment? Since it's not OpenGL's responsibility, it has to be done by someone else, and it has to be done in a way that is compliant with rules of the system that hosts the rendering application.

That's where the EGL place is - it defines an API that gets translated to underlying windowing system calls by some library. Like GLX and WGL is responsible for creation of OpenGL context on Linux and Windows, EGL is responsible for creation of OpenGL ES context in embedded systems. Android is not the only platform that's using EGL, pretty much all the Linux-capable single-SoC ARM computers will expose EGL API, so apps would be able to create a valid rendering context.

If you never used EGL api - then it means you never wrote the native applications for Android, or some other java class (like GLSurfaceView) is wrapping up things for you. Look at the basic GLES examples, you'll find lots of references to EGL stuff. At the minimum you'd be asked to provide the EGLConfigChooser, or at least give some parameters to implicitly created EGLConfigChoser.

Vlad
  • 5,450
  • 1
  • 12
  • 19