# lv_opengles_driver.h (/api/drivers/opengles/lv_opengles_driver_h)



<ApiSummary functions="8" />

Functions [#functions]

<ApiMember kind="function" name="lv_opengles_init" file="drivers/opengles/lv_opengles_driver.h" line="39" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L39">
  lv_opengles_init [#lv_opengles_init]

  Initialize OpenGL

  ```c title=" " lineNumbers=1
  void lv_opengles_init(void)
  ```

  <Callout type="info">
    it is not necessary to call this if you use `lv_opengles_glfw_window_create`
  </Callout>
</ApiMember>

<ApiMember kind="function" name="lv_opengles_deinit" file="drivers/opengles/lv_opengles_driver.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L45">
  lv_opengles_deinit [#lv_opengles_deinit]

  Deinitialize OpenGL

  ```c title=" " lineNumbers=1
  void lv_opengles_deinit(void)
  ```

  <Callout type="info">
    it is not necessary to call this if you use `lv_opengles_glfw_window_create`
  </Callout>
</ApiMember>

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

  Render a texture using alternate blending mode for smoother translucent materials and correct anti-aliasing of glTF elements when using transparent background

  ```c title=" " lineNumbers=1
  void lv_opengles_render_texture(unsigned int texture, const lv_area_t *texture_area, lv_opa_t opa, int32_t disp_w, int32_t disp_h, const lv_area_t *texture_clip_area, bool h_flip, bool v_flip)
  ```

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

  | Name                | Type                                                     | Description                                         |
  | ------------------- | -------------------------------------------------------- | --------------------------------------------------- |
  | `texture`           | `unsigned int`                                           | OpenGL texture ID                                   |
  | `texture_area`      | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | the area in the window to render the texture in     |
  | `opa`               | <ApiLink name="lv_opa_t" />                              | opacity to blend the texture with existing contents |
  | `disp_w`            | <ApiLink name="int32_t" />                               | width of the window/framebuffer being rendered to   |
  | `disp_h`            | <ApiLink name="int32_t" />                               | height of the window/framebuffer being rendered to  |
  | `texture_clip_area` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> |                                                     |
  | `h_flip`            | <ApiLink name="bool" />                                  | horizontal flip                                     |
  | `v_flip`            | <ApiLink name="bool" />                                  | vertical flip                                       |
</ApiMember>

<ApiMember kind="function" name="lv_opengles_render_display_texture" file="drivers/opengles/lv_opengles_driver.h" line="66" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L66">
  lv_opengles_render_display_texture [#lv_opengles_render_display_texture]

  Render a display texture - Supports rotation - Switches red and blue channels

  ```c title=" " lineNumbers=1
  void lv_opengles_render_display_texture(lv_display_t *display, bool h_flip, bool v_flip)
  ```

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

  | Name      | Type                                                     | Description                                                         |
  | --------- | -------------------------------------------------------- | ------------------------------------------------------------------- |
  | `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | LVGL Texture display. Created with the `lv_opengles_texture` module |
  | `h_flip`  | <ApiLink name="bool" />                                  | horizontal flip                                                     |
  | `v_flip`  | <ApiLink name="bool" />                                  | vertical flip                                                       |
</ApiMember>

<ApiMember kind="function" name="lv_opengles_render_fill" file="drivers/opengles/lv_opengles_driver.h" line="76" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L76">
  lv_opengles_render_fill [#lv_opengles_render_fill]

  Render a fill

  ```c title=" " lineNumbers=1
  void lv_opengles_render_fill(lv_color_t color, const lv_area_t *area, lv_opa_t opa, int32_t disp_w, int32_t disp_h)
  ```

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

  | Name     | Type                                                     | Description                                        |
  | -------- | -------------------------------------------------------- | -------------------------------------------------- |
  | `color`  | <ApiLink name="lv_color_t" />                            | the color of the fill                              |
  | `area`   | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | the area in the window to render the fill          |
  | `opa`    | <ApiLink name="lv_opa_t" />                              | opacity to blend the fill with existing contents   |
  | `disp_w` | <ApiLink name="int32_t" />                               | width of the window/framebuffer being rendered to  |
  | `disp_h` | <ApiLink name="int32_t" />                               | height of the window/framebuffer being rendered to |
</ApiMember>

<ApiMember kind="function" name="lv_opengles_render_clear" file="drivers/opengles/lv_opengles_driver.h" line="81" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L81">
  lv_opengles_render_clear [#lv_opengles_render_clear]

  Clear the window/display

  ```c title=" " lineNumbers=1
  void lv_opengles_render_clear(void)
  ```
</ApiMember>

<ApiMember kind="function" name="lv_opengles_viewport" file="drivers/opengles/lv_opengles_driver.h" line="90" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L90">
  lv_opengles_viewport [#lv_opengles_viewport]

  Set the OpenGL viewport

  ```c title=" " lineNumbers=1
  void lv_opengles_viewport(int32_t x, int32_t y, int32_t w, int32_t h)
  ```

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

  | Name | Type                       | Description                |
  | ---- | -------------------------- | -------------------------- |
  | `x`  | <ApiLink name="int32_t" /> | x position of the viewport |
  | `y`  | <ApiLink name="int32_t" /> | y position of the viewport |
  | `w`  | <ApiLink name="int32_t" /> | width of the viewport      |
  | `h`  | <ApiLink name="int32_t" /> | height of the viewport     |
</ApiMember>

<ApiMember kind="function" name="lv_opengles_reinit_state" file="drivers/opengles/lv_opengles_driver.h" line="96" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_driver.h#L96">
  lv_opengles_reinit_state [#lv_opengles_reinit_state]

  Reinitialize OpenGL state after external GL operations (e.g., NanoVG) This rebinds VAO, VBO, IBO and resets vertex attributes

  ```c title=" " lineNumbers=1
  void lv_opengles_reinit_state(void)
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_color.h&#x22;]" includedBy="[&#x22;lv_drivers.h&#x22;]" transitiveIncludes="[&#x22;lv_assert.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_types.h&#x22;]" />
