1 /** 2 * @file lv_opengles_driver.h 3 * 4 */ 5 6 #ifndef LV_OPENGLES_DRIVER_H 7 #define LV_OPENGLES_DRIVER_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 17 #include "../../lv_conf_internal.h" 18 #if LV_USE_OPENGLES 19 20 #include "../../misc/lv_area.h" 21 #include "../../misc/lv_color.h" 22 23 /********************* 24 * DEFINES 25 *********************/ 26 27 /********************** 28 * TYPEDEFS 29 **********************/ 30 31 /********************** 32 * GLOBAL PROTOTYPES 33 **********************/ 34 35 /** 36 * Initialize OpenGL 37 * @note it is not necessary to call this if you use `lv_glfw_window_create` 38 */ 39 void lv_opengles_init(void); 40 41 /** 42 * Deinitialize OpenGL 43 * @note it is not necessary to call this if you use `lv_glfw_window_create` 44 */ 45 void lv_opengles_deinit(void); 46 47 /** 48 * Render a texture 49 * @param texture OpenGL texture ID 50 * @param texture_area the area in the window to render the texture in 51 * @param opa opacity to blend the texture with existing contents 52 * @param disp_w width of the window/framebuffer being rendered to 53 * @param disp_h height of the window/framebuffer being rendered to 54 */ 55 void lv_opengles_render_texture(unsigned int texture, const lv_area_t * texture_area, lv_opa_t opa, int32_t disp_w, 56 int32_t disp_h, const lv_area_t * texture_clip_area, bool flip); 57 58 /** 59 * Render a fill 60 * @param color the color of the fill 61 * @param area the area in the window to render the fill 62 * @param opa opacity to blend the fill with existing contents 63 * @param disp_w width of the window/framebuffer being rendered to 64 * @param disp_h height of the window/framebuffer being rendered to 65 */ 66 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); 67 68 /** 69 * Clear the window/display 70 */ 71 void lv_opengles_render_clear(void); 72 73 /** 74 * Set the OpenGL viewport 75 * @param x x position of the viewport 76 * @param y y position of the viewport 77 * @param w width of the viewport 78 * @param h height of the viewport 79 */ 80 void lv_opengles_viewport(int32_t x, int32_t y, int32_t w, int32_t h); 81 82 /********************** 83 * MACROS 84 **********************/ 85 86 #endif /* LV_USE_OPENGLES */ 87 88 #ifdef __cplusplus 89 } /* extern "C" */ 90 #endif 91 92 #endif /* LV_OPENGLES_DRIVER_H */ 93