# lv_opengles_texture.h (/api/drivers/opengles/lv_opengles_texture_h)



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

<ApiSummary functions="4" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (2)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_opengles_texture_get_texture_id" file="drivers/opengles/lv_opengles_texture.h" line="60" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_texture.h#L60">
      lv_opengles_texture_get_texture_id [#lv_opengles_texture_get_texture_id]

      Get the OpenGL texture ID of the display

      ```c title=" " lineNumbers=1
      unsigned int lv_opengles_texture_get_texture_id(lv_display_t *disp)
      ```

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

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

      **Returns:** `unsigned int` — texture ID
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_texture_get_from_texture_id" file="drivers/opengles/lv_opengles_texture.h" line="67" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_texture.h#L67">
      lv_opengles_texture_get_from_texture_id [#lv_opengles_texture_get_from_texture_id]

      Get the display of an OpenGL texture if it is associated with one

      ```c title=" " lineNumbers=1
      lv_display_t * lv_opengles_texture_get_from_texture_id(unsigned int texture_id)
      ```

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

      | Name         | Type           | Description       |
      | ------------ | -------------- | ----------------- |
      | `texture_id` | `unsigned int` | OpenGL texture ID |

      **Returns:** <ApiLink name="lv_display_t" display="lv_display_t *" /> — display or `NULL` if there no display with that texture ID
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_opengles_texture_create" file="drivers/opengles/lv_opengles_texture.h" line="42" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_texture.h#L42">
      lv_opengles_texture_create [#lv_opengles_texture_create]

      Create a display that flushes to an OpenGL texture If you already have a texture and want to bind it to the display, see `lv_opengles_texture_create_from_texture_id`

      ```c title=" " lineNumbers=1
      lv_display_t * lv_opengles_texture_create(int32_t w, int32_t h)
      ```

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

      | Name | Type                       | Description                     |
      | ---- | -------------------------- | ------------------------------- |
      | `w`  | <ApiLink name="int32_t" /> | width in pixels of the texture  |
      | `h`  | <ApiLink name="int32_t" /> | height in pixels of the texture |

      **Returns:** <ApiLink name="lv_display_t" display="lv_display_t *" /> — the new display or NULL on failure
    </ApiMember>

    <ApiMember kind="function" name="lv_opengles_texture_create_from_texture_id" file="drivers/opengles/lv_opengles_texture.h" line="53" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/opengles/lv_opengles_texture.h#L53">
      lv_opengles_texture_create_from_texture_id [#lv_opengles_texture_create_from_texture_id]

      Create a display that flushes to the provided OpenGL texture If you don't have a texture to bind it to the display, see `lv_opengles_texture_create`

      ```c title=" " lineNumbers=1
      lv_display_t * lv_opengles_texture_create_from_texture_id(int32_t w, int32_t h, unsigned int texture_id)
      ```

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

      | Name         | Type                       | Description                     |
      | ------------ | -------------------------- | ------------------------------- |
      | `w`          | <ApiLink name="int32_t" /> | width in pixels of the texture  |
      | `h`          | <ApiLink name="int32_t" /> | height in pixels of the texture |
      | `texture_id` | `unsigned int`             | the texture LVGL will render to |

      **Returns:** <ApiLink name="lv_display_t" display="lv_display_t *" /> — the new display or NULL on failure
    </ApiMember>
  </ApiTab>
</ApiTabs>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_display.h&#x22;]" includedBy="[&#x22;lv_drivers.h&#x22;, &#x22;lv_opengles_texture_private.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ll.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_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
