# androidx.graphics.opengl.egl

*** ** * ** ***

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLSpec` | Interface for accessing various EGL facilities independent of EGL versions. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes` | Class responsible for containing configuration parameters to be consumed by `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLSpec#loadConfig(androidx.graphics.opengl.egl.EGLConfigAttributes)` This contains a mapping of key value pairs for attribute names to values. |
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes.Builder` | Builder used to create an instance of `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes` Allows for a mapping of EGL configuration attributes to their corresponding values as well as including a previously generated `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes` instance to be used as a template and conditionally update individual mapped values |
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLManager` | Class responsible for configuration of EGL related resources. |
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLVersion` | Identifier for the current EGL implementation |

## Exceptions

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLException` | Exception class for reporting errors with EGL |

## Top-level functions summary

|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes` | `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/package-summary#EGLConfigAttributes(kotlin.Function1)(block: https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes.Builder.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Construct an instance of `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/package-summary#EGLConfigAttributes(kotlin.Function1)` that includes a mapping of EGL attributes to their corresponding value. |

## Top-level functions

### EGLConfigAttributes

Artifact: [androidx.graphics:graphics-core](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/opengl/egl/EGLConfigAttributes.kt+function:EGLConfigAttributes) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
inline fun EGLConfigAttributes(block: EGLConfigAttributes.Builder.() -> Unit): EGLConfigAttributes
```

Construct an instance of `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/package-summary#EGLConfigAttributes(kotlin.Function1)` that includes a mapping of EGL attributes to their corresponding value. The full set of attributes can be found here: https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglChooseConfig.xhtml

The resultant array of attributes automatically is terminated with EGL_NONE.

For example to create an 8888 configuration, this can be done with the following:

```kotlin
EGLConfigAttributes {
     EGL14.EGL_RENDERABLE_TYPE to EGL14.EGL_OPENGL_ES2_BIT
     EGL14.EGL_RED_SIZE to 8
     EGL14.EGL_GREEN_SIZE to 8
     EGL14.EGL_BLUE_SIZE to 8
     EGL14.EGL_ALPHA_SIZE to 8
     EGL14.EGL_DEPTH_SIZE to 0
     EGL14.EGL_CONFIG_CAVEAT to EGL14.EGL_NONE
     EGL14.EGL_STENCIL_SIZE to 8
     EGL14.EGL_SURFACE_TYPE to EGL14.EGL_WINDOW_BIT
}
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/opengl/egl/EGLConfigAttributes#RGBA_8888()` |   |