2 RetroRay - integrated standalone vintage modeller/renderer
3 Copyright (C) 2023 John Tsiombikas <nuclear@mutantstargoat.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
30 KEY_NUM_0 = 256, KEY_NUM_1, KEY_NUM_2, KEY_NUM_3, KEY_NUM_4,
31 KEY_NUM_5, KEY_NUM_6, KEY_NUM_7, KEY_NUM_8, KEY_NUM_9,
32 KEY_NUM_DOT, KEY_NUM_DIV, KEY_NUM_MUL, KEY_NUM_MINUS, KEY_NUM_PLUS, KEY_NUM_ENTER, KEY_NUM_EQUALS,
33 KEY_UP, KEY_DOWN, KEY_RIGHT, KEY_LEFT,
34 KEY_INS, KEY_HOME, KEY_END, KEY_PGUP, KEY_PGDN,
35 KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6,
36 KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12,
37 KEY_F13, KEY_F14, KEY_F15,
38 KEY_NUMLK, KEY_CAPSLK, KEY_SCRLK,
39 KEY_RSHIFT, KEY_LSHIFT, KEY_RCTRL, KEY_LCTRL, KEY_RALT, KEY_LALT,
40 KEY_RMETA, KEY_LMETA, KEY_LSUPER, KEY_RSUPER, KEY_MODE, KEY_COMPOSE,
41 KEY_HELP, KEY_PRINT, KEY_SYSRQ, KEY_BREAK
48 #define KEY_SHIFT (-4)
62 void (*destroy)(void);
65 void (*display)(void);
66 void (*reshape)(int, int);
67 void (*keyboard)(int, int);
68 void (*mouse)(int, int, int, int);
69 void (*motion)(int, int);
70 void (*sball_motion)(int, int, int);
71 void (*sball_rotate)(int, int, int);
72 void (*sball_button)(int, int);
75 extern int mouse_x, mouse_y, mouse_state[3];
76 extern unsigned int modkeys;
77 extern int win_width, win_height;
78 extern float win_aspect;
81 extern long time_msec;
82 extern struct app_screen *cur_scr;
83 extern struct app_screen scr_model, scr_rend;
86 extern struct font *uifont;
88 extern uint32_t *framebuf, *rendbuf;
90 extern struct scene *scn;
94 void app_shutdown(void);
96 void app_display(void);
97 void app_reshape(int x, int y);
98 void app_keyboard(int key, int press);
99 void app_mouse(int bn, int st, int x, int y);
100 void app_motion(int x, int y);
101 void app_sball_motion(int x, int y, int z);
102 void app_sball_rotate(int x, int y, int z);
103 void app_sball_button(int bn, int st);
105 void app_chscr(struct app_screen *scr);
107 /* defined in main.c */
108 long app_getmsec(void);
109 void app_redisplay(void);
110 void app_swap_buffers(void);
112 void app_resize(int x, int y);
113 void app_fullscreen(int fs);
114 void app_vsync(int vsync);
116 /* defined in scr_mod.c for convenience */
117 void primray(cgm_ray *ray, int x, int y);