lv_glfw_window.h

Functions

lv_glfw_window_t *lv_glfw_window_create(int32_t hor_res, int32_t ver_res, bool use_mouse_indev)

Create a GLFW window with no textures and initialize OpenGL

Parameters:
  • hor_res – width in pixels of the window

  • ver_res – height in pixels of the window

  • use_mouse_indev – send pointer indev input to LVGL display textures

Returns:

the new GLFW window handle

void lv_glfw_window_delete(lv_glfw_window_t *window)

Delete a GLFW window. If it is the last one, the process will exit

Parameters:

window – GLFW window to delete

lv_glfw_texture_t *lv_glfw_window_add_texture(lv_glfw_window_t *window, unsigned int texture_id, int32_t w, int32_t h)

Add a texture to the GLFW window. It can be an LVGL display texture, or any OpenGL texture

Parameters:
  • window – GLFW window

  • texture_id – OpenGL texture ID

  • w – width in pixels of the texture

  • h – height in pixels of the texture

Returns:

the new texture handle

void lv_glfw_texture_remove(lv_glfw_texture_t *texture)

Remove a texture from its GLFW window and delete it

Parameters:

texture – handle of a GLFW window texture

void lv_glfw_texture_set_x(lv_glfw_texture_t *texture, int32_t x)

Set the x position of a texture within its GLFW window

Parameters:
  • texture – handle of a GLFW window texture

  • x – new x position of the texture

void lv_glfw_texture_set_y(lv_glfw_texture_t *texture, int32_t y)

Set the y position of a texture within its GLFW window

Parameters:
  • texture – handle of a GLFW window texture

  • y – new y position of the texture

void lv_glfw_texture_set_opa(lv_glfw_texture_t *texture, lv_opa_t opa)

Set the opacity of a texture in a GLFW window

Parameters:
  • texture – handle of a GLFW window texture

  • opa – new opacity of the texture

lv_indev_t *lv_glfw_texture_get_mouse_indev(lv_glfw_texture_t *texture)

Get the mouse indev associated with a texture in a GLFW window, if it exists

Note

there will only be an indev if the texture is based on an LVGL display texture and the window was created with use_mouse_indev as true

Parameters:

texture – handle of a GLFW window texture

Returns:

the indev or NULL