# lv_opengles_egl.h (/api/private/drivers/opengles/lv_opengles_egl_h)



<RelatedHeaders name="lv_opengles_egl_private.h" isPrivate="false" />

<ApiSummary functions="7" typedefs="3" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Getters (1)&#x22;,&#x22;Other (5)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_opengles_egl_set_display_color_format" file="private/drivers/opengles/lv_opengles_egl.h" line="54" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L54">
      lv_opengles_egl_set_display_color_format [#lv_opengles_egl_set_display_color_format]

      Modifies display color format to ensure the selected color format is opengl compatible else it falls back to `LV_COLOR_FORMAT_ARGB8888` and logs a warning.

      ```c title=" " lineNumbers=1
      lv_color_format_t lv_opengles_egl_set_display_color_format(lv_display_t *display)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                     | Description          |
      | --------- | -------------------------------------------------------- | -------------------- |
      | `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | the display to check |

      **Returns:** <ApiLink name="lv_color_format_t" /> — the color format the display uses after the call
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_opengles_egl_get_gles_version" file="private/drivers/opengles/lv_opengles_egl.h" line="46" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L46">
      lv_opengles_egl_get_gles_version [#lv_opengles_egl_get_gles_version]

      Get the OpenGL ES major version of the context that was actually created. An ES3 context is always requested first, but drivers that cannot provide one fall back to ES2. Features needing ES3 shaders (e.g. glTF) must check this.

      ```c title=" " lineNumbers=1
      uint8_t lv_opengles_egl_get_gles_version(lv_opengles_egl_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                               | Description     |
      | ----- | ------------------------------------------------------------------ | --------------- |
      | `ctx` | <ApiLink name="lv_opengles_egl_t" display="lv_opengles_egl_t *" /> | the EGL context |

      **Returns:** `uint8_t` — 3 or 2
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (5)">
    <ApiMember kind="function" name="lv_opengles_egl_context_create" file="private/drivers/opengles/lv_opengles_egl.h" line="36" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L36">
      lv_opengles_egl_context_create [#lv_opengles_egl_context_create]

      ```c title=" " lineNumbers=1
      lv_opengles_egl_t * lv_opengles_egl_context_create(const lv_egl_interface_t *interface)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                                                       |
      | ----------- | -------------------------------------------------------------------------- |
      | `interface` | <ApiLink name="lv_egl_interface_t" display="const lv_egl_interface_t *" /> |
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_egl_color_format_from_egl_config" file="private/drivers/opengles/lv_opengles_egl.h" line="37" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L37">
      lv_opengles_egl_color_format_from_egl_config [#lv_opengles_egl_color_format_from_egl_config]

      ```c title=" " lineNumbers=1
      lv_color_format_t lv_opengles_egl_color_format_from_egl_config(const lv_egl_config_t *config)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                                                 |
      | -------- | -------------------------------------------------------------------- |
      | `config` | <ApiLink name="lv_egl_config_t" display="const lv_egl_config_t *" /> |
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_egl_update" file="private/drivers/opengles/lv_opengles_egl.h" line="56" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L56">
      lv_opengles_egl_update [#lv_opengles_egl_update]

      ```c title=" " lineNumbers=1
      void lv_opengles_egl_update(lv_opengles_egl_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                               |
      | ----- | ------------------------------------------------------------------ |
      | `ctx` | <ApiLink name="lv_opengles_egl_t" display="lv_opengles_egl_t *" /> |
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_egl_clear" file="private/drivers/opengles/lv_opengles_egl.h" line="57" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L57">
      lv_opengles_egl_clear [#lv_opengles_egl_clear]

      ```c title=" " lineNumbers=1
      void lv_opengles_egl_clear(lv_opengles_egl_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                               |
      | ----- | ------------------------------------------------------------------ |
      | `ctx` | <ApiLink name="lv_opengles_egl_t" display="lv_opengles_egl_t *" /> |
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_egl_context_destroy" file="private/drivers/opengles/lv_opengles_egl.h" line="58" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L58">
      lv_opengles_egl_context_destroy [#lv_opengles_egl_context_destroy]

      ```c title=" " lineNumbers=1
      void lv_opengles_egl_context_destroy(lv_opengles_egl_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                               |
      | ----- | ------------------------------------------------------------------ |
      | `ctx` | <ApiLink name="lv_opengles_egl_t" display="lv_opengles_egl_t *" /> |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_opengles_egl_t" file="private/drivers/opengles/lv_opengles_egl.h" line="28" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L28">
  lv_opengles_egl_t [#lv_opengles_egl_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_opengles_egl lv_opengles_egl_t
  ```
</ApiMember>

<TypeUsedBy name="lv_opengles_egl_t" count="4">
  * `lv_opengles_egl_get_gles_version` — param `ctx`
  * `lv_opengles_egl_update` — param `ctx`
  * `lv_opengles_egl_clear` — param `ctx`
  * `lv_opengles_egl_context_destroy` — param `ctx`
</TypeUsedBy>

<ApiMember kind="typedef" name="lv_egl_interface_t" file="private/drivers/opengles/lv_opengles_egl.h" line="29" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L29">
  lv_egl_interface_t [#lv_egl_interface_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_egl_interface lv_egl_interface_t
  ```
</ApiMember>

<TypeUsedBy name="lv_egl_interface_t" count="1">
  * `lv_opengles_egl_context_create` — param `interface`
</TypeUsedBy>

<ApiMember kind="typedef" name="lv_egl_config_t" file="private/drivers/opengles/lv_opengles_egl.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/drivers/opengles/lv_opengles_egl.h#L30">
  lv_egl_config_t [#lv_egl_config_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_egl_config lv_egl_config_t
  ```
</ApiMember>

<TypeUsedBy name="lv_egl_config_t" count="2">
  * `lv_opengles_egl_color_format_from_egl_config` — param `config`
  * `lv_opengles_egl_display_select_config` — param `configs`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lvgl_public.h&#x22;]" includedBy="[&#x22;lv_linux_drm_egl_private.h&#x22;, &#x22;lv_opengles_egl_private.h&#x22;, &#x22;lvgl_private.h&#x22;]" />
