DEADSOFTWARE

files: move resource manager to system drivers
[flatwaifu.git] / src / system.h
1 /* Copyright (C) 2020 SovietPony
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
16 #ifndef SYSTEM_H_INCLUDED
17 #define SYSTEM_H_INCLUDED
19 #include "glob.h"
21 enum { Y_BYTE = 1, Y_WORD, Y_DWORD, Y_STRING, Y_SW_ON, Y_SW_OFF, Y_FILES, Y_KEY };
23 typedef struct cfg_t {
24 const char *cfg;
25 void *p;
26 byte t;
27 } cfg_t;
29 typedef struct videomode_size_t {
30 int w, h, r;
31 } videomode_size_t;
33 typedef struct videomode_t {
34 int n;
35 videomode_size_t *modes;
36 } videomode_t;
38 /* common video subsystem routines */
39 void Y_get_videomode (int *w, int *h);
40 int Y_videomode_setted (void);
41 void Y_unset_videomode (void);
42 void Y_set_fullscreen (int yes);
43 int Y_get_fullscreen (void);
45 /* hardware specific rendering */
46 int Y_set_videomode_opengl (int w, int h, int fullscreen);
47 const videomode_t *Y_get_videomode_list_opengl (int fullscreen);
48 void Y_swap_buffers (void);
50 /* software specific rendering */
51 int Y_set_videomode_software (int w, int h, int fullscreen);
52 const videomode_t *Y_get_videomode_list_software (int fullscreen);
53 void Y_get_buffer (byte **buf, int *w, int *h, int *pitch);
54 void Y_set_vga_palette (byte *vgapal);
55 void Y_repaint_rect (int x, int y, int w, int h);
56 void Y_repaint (void);
58 /* input */
59 void Y_enable_text_input (void);
60 void Y_disable_text_input (void);
62 #endif /* SYSTEM_H_INCLUDED */