EGLConfigAttributes.Builder


class EGLConfigAttributes.Builder


Builder used to create an instance of EGLConfigAttributes Allows for a mapping of EGL configuration attributes to their corresponding values as well as including a previously generated EGLConfigAttributes instance to be used as a template and conditionally update individual mapped values

Summary

Public functions

EGLConfigAttributes

Construct an instance of EGLConfigAttributes with the mappings of integer keys to their respective values.

Unit

Include all the attributes of the given EGLConfigAttributes instance.

EGLConfigAttributes.Builder
setAttribute(attribute: Int, value: Int)

Map a given EGL configuration attribute key to the given EGL configuration value

infix Unit
Int.to(that: Int)

Map a given EGL configuration attribute key to the given EGL configuration value

Public functions

build

Added in 1.0.0-rc01
fun build(): EGLConfigAttributes

Construct an instance of EGLConfigAttributes with the mappings of integer keys to their respective values. This creates a flat integer array with alternating values for the key value pairs and ends with EGL_NONE

include

Added in 1.0.0-rc01
fun include(attributes: EGLConfigAttributes): Unit

Include all the attributes of the given EGLConfigAttributes instance. This is useful for creating a new EGLConfigAttributes instance with all the same attributes as another, allowing for modification of attributes after the fact. For example, the following code snippet can be used to create an EGLConfigAttributes instance that has all the same configuration as RGBA_8888 but with a 16 bit stencil buffer size:

EGLConfigAttributes { include(EGLConfigAttributes.RGBA_8888) EGL14.EGL_STENCIL_SIZE to 16 }

That is all attributes configured after the include will overwrite the attributes configured previously.

setAttribute

Added in 1.0.0-rc01
fun setAttribute(attribute: Int, value: Int): EGLConfigAttributes.Builder

Map a given EGL configuration attribute key to the given EGL configuration value

Parameters
attribute: Int

EGL attribute name such as EGL14.EGL_RED_SIZE

value: Int

Corresponding value for the attribute

infix fun Int.to(that: Int): Unit

Map a given EGL configuration attribute key to the given EGL configuration value