win32 mingw fixes
[laserbrain_demo] / src / app.h
1 #ifndef APP_H_
2 #define APP_H_
3
4 #include "texture.h"
5 #include "scene.h"
6
7 extern long time_msec;
8 extern int win_width, win_height;
9 extern float win_aspect;
10 extern bool opt_gear_wireframe;
11 extern bool fb_srgb;
12
13 extern TextureSet texman;
14 extern SceneSet sceneman;
15
16 extern unsigned int sdr_ltmap, sdr_ltmap_notex;
17
18 enum {
19         MOD_SHIFT       = 1,
20         MOD_ALT         = 2,
21         MOD_CTRL        = 4
22 };
23
24 /* special keys */
25 enum {
26         KEY_DEL = 127,
27         KEY_LEFT,
28         KEY_RIGHT,
29         KEY_UP,
30         KEY_DOWN,
31         KEY_PGUP,
32         KEY_PGDOWN,
33         KEY_HOME,
34         KEY_END,
35         KEY_F1,
36         KEY_F2,
37         KEY_F3,
38         KEY_F4,
39         KEY_F5,
40         KEY_F6,
41         KEY_F7,
42         KEY_F8,
43         KEY_F9,
44         KEY_F10,
45         KEY_F11,
46         KEY_F12
47 };
48
49 /* XXX make sure these match with SDL_GameControllerButton */
50 enum {
51         GPAD_A,
52         GPAD_B,
53         GPAD_X,
54         GPAD_Y,
55         GPAD_BACK,
56         GPAD_GUIDE,
57         GPAD_START,
58         GPAD_LSTICK,
59         GPAD_RSTICK,
60         GPAD_L,
61         GPAD_R,
62         GPAD_UP,
63         GPAD_DOWN,
64         GPAD_LEFT,
65         GPAD_RIGHT,
66 };
67
68 bool app_init(int argc, char **argv);
69 void app_cleanup();
70
71 void app_display();
72 void app_reshape(int x, int y);
73
74 void app_keyboard(int key, bool pressed);
75 void app_mouse_button(int bn, bool pressed, int x, int y);
76 void app_mouse_motion(int x, int y);
77 void app_mouse_delta(int dx, int dy);
78 void app_mouse_wheel(int dir);
79
80 void app_gamepad_axis(int axis, float val);
81 void app_gamepad_button(int bn, bool pressed);
82
83 // the following functions are implemented by the backend (main.cc)
84 void app_quit();
85 void app_swap_buffers();
86 unsigned int app_get_modifiers();
87
88 void app_resize(int x, int y);
89 void app_fullscreen(bool fs);
90 void app_toggle_fullscreen();
91 bool app_is_fullscreen();
92 void app_grab_mouse(bool grab);
93 void app_toggle_grab_mouse();
94 bool app_is_mouse_grabbed();
95
96 #endif  // APP_H_