1 /**
2  * @file lv_draw_sdl.h
3  *
4  */
5 
6 #ifndef LV_DRAW_SDL_H
7 #define LV_DRAW_SDL_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../../lv_conf_internal.h"
17 
18 #if LV_USE_GPU_SDL
19 
20 #include LV_GPU_SDL_INCLUDE_PATH
21 
22 #include "../lv_draw.h"
23 #include "../../core/lv_disp.h"
24 
25 /*********************
26  *      DEFINES
27  *********************/
28 
29 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
30 #define LV_DRAW_SDL_TEXTURE_FORMAT SDL_PIXELFORMAT_ARGB8888
31 #else
32 #define LV_DRAW_SDL_TEXTURE_FORMAT SDL_PIXELFORMAT_RGBA8888
33 #endif
34 
35 /**********************
36  *      TYPEDEFS
37  **********************/
38 
39 struct lv_draw_sdl_context_internals_t;
40 
41 typedef struct {
42     /**
43      * Render for display driver
44      */
45     SDL_Renderer * renderer;
46     void * user_data;
47 } lv_draw_sdl_drv_param_t;
48 
49 typedef struct {
50     lv_draw_ctx_t base_draw;
51     SDL_Renderer * renderer;
52     struct lv_draw_sdl_context_internals_t * internals;
53 } lv_draw_sdl_ctx_t;
54 
55 /**********************
56  * GLOBAL PROTOTYPES
57  **********************/
58 
59 void lv_draw_sdl_init_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx);
60 
61 /**
62  * @brief Free caches
63  *
64  */
65 void lv_draw_sdl_deinit_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx);
66 
67 SDL_Texture * lv_draw_sdl_create_screen_texture(SDL_Renderer * renderer, lv_coord_t hor, lv_coord_t ver);
68 
69 /*======================
70  * Add/remove functions
71  *=====================*/
72 
73 /*=====================
74  * Setter functions
75  *====================*/
76 
77 /*=====================
78  * Getter functions
79  *====================*/
80 
81 /*=====================
82  * Other functions
83  *====================*/
84 
85 /**********************
86  *      MACROS
87  **********************/
88 
89 #endif /*LV_USE_GPU_SDL*/
90 
91 #ifdef __cplusplus
92 } /*extern "C"*/
93 #endif
94 
95 #endif /*LV_DRAW_SDL_H*/
96