1 /*
2  * Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
3  * Copyright (c) 2023 Nordic Semiconductor
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  *
7  * "Bottom" of the SDL display driver.
8  * When built with the native_simulator this will be built in the runner context,
9  * that is, with the host C library, and with the host include paths.
10  */
11 #ifndef DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H
12 #define DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H
13 
14 #include <stdbool.h>
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /* Note: None of these functions are public interfaces. But internal to the SDL display driver */
22 
23 int sdl_display_init_bottom(uint16_t height, uint16_t width, uint16_t zoom_pct,
24 			    bool use_accelerator, void **window, void **renderer, void **mutex,
25 			    void **texture, void **read_texture, void **background_texture,
26 			    uint32_t transparency_grid_color1, uint32_t transparency_grid_color2,
27 			    uint16_t transparency_grid_cell_size);
28 void sdl_display_write_bottom(const uint16_t height, const uint16_t width, const uint16_t x,
29 			      const uint16_t y, void *renderer, void *mutex, void *texture,
30 			      void *background_texture, uint8_t *buf, bool display_on,
31 			      bool frame_incomplete);
32 int sdl_display_read_bottom(const uint16_t height, const uint16_t width, const uint16_t x,
33 			    const uint16_t y, void *renderer, void *buf, uint16_t pitch,
34 			    void *mutex, void *texture, void *read_texture);
35 void sdl_display_blanking_off_bottom(void *renderer, void *texture, void *background_texture);
36 void sdl_display_blanking_on_bottom(void *renderer);
37 void sdl_display_cleanup_bottom(void **window, void **renderer, void **mutex, void **texture,
38 				void **read_texture, void **background_texture);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* DRIVERS_DISPLAY_DISPLAY_SDL_BOTTOM_H */
45