VSF Documented
vsf_disp_sdl2.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17#ifndef __VSF_DISP_SDL2_H__
18#define __VSF_DISP_SDL2_H__
19
20/*============================ INCLUDES ======================================*/
21
23
24#if VSF_USE_UI == ENABLED && VSF_DISP_USE_SDL2 == ENABLED
25
26#include "hal/vsf_hal.h"
27
28#if defined(__VSF_DISP_SDL2_CLASS_IMPLEMENT)
29# undef __VSF_DISP_SDL2_CLASS_IMPLEMENT
30# define __VSF_CLASS_IMPLEMENT__
31#endif
32
33#include "utilities/ooc_class.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/*============================ MACROS ========================================*/
40
41#if !defined(__WIN__) && !defined(__LINUX__) && !defined(__MACOS__)
42# error "vsf_disp_sdl2 ONLY support win/linux/macos"
43#endif
44
45// if VSF_DISP_USE_SDL2 is used, SDL header files are not visible in vsf header files
46// so define main to SDL_main for SDL
47#if defined(__WIN__)
48# define main SDL_main
49#elif defined(__LINUX__)
50#endif
51
52/*============================ MACROFIED FUNCTIONS ===========================*/
53/*============================ TYPES =========================================*/
54
56 public_member(
57 implement(vk_disp_t)
58 char * title;
59 uint8_t amplifier;
60 uint8_t flush_delay_ms;
61 )
62
63 private_member(
64 vsf_arch_irq_thread_t event_thread;
65 vsf_arch_irq_thread_t flush_thread;
66 vsf_arch_irq_request_t flush_request;
67 vk_disp_area_t area;
68 void *disp_buff;
69
70#if 0
71 // SDL_XXXX not visible in header files
72 SDL_Window *window;
73 SDL_Renderer *renderer;
74 SDL_Texture *texture;
75#else
76 void *window;
77 void *renderer;
78 void *texture;
79#endif
80 )
81};
82
83/*============================ GLOBAL VARIABLES ==============================*/
84
86
87/*============================ PROTOTYPES ====================================*/
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif // VSF_USE_UI
94#endif // __VSF_DISP_SDL2_H__
Definition vsf_disp.h:149
Definition vsf_disp_sdl2.h:55
Definition vsf_disp.h:173
Definition linux_generic.h:104
Definition linux_generic.h:122
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_sdl2.c:82
Definition vsf_sdl2.c:95
Definition vsf_sdl2.c:73
Definition vsf_disp.h:144
const vk_disp_drv_t vk_disp_drv_sdl2
Definition vsf_disp_sdl2.c:102