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