- fixed retarded mouse
[laserbrain_demo] / src / app.h
1 #ifndef APP_H_
2 #define APP_H_
3
4 extern long time_msec;
5 extern int win_width, win_height;
6 extern float win_aspect;
7 extern bool opt_gear_wireframe;
8 extern bool fb_srgb;
9
10 extern unsigned int sdr_ltmap, sdr_ltmap_notex;
11
12 enum {
13         MOD_SHIFT       = 1,
14         MOD_ALT         = 2,
15         MOD_CTRL        = 4
16 };
17
18 /* XXX make sure these match with SDL_GameControllerButton */
19 enum {
20         GPAD_A,
21         GPAD_B,
22         GPAD_X,
23         GPAD_Y,
24         GPAD_BACK,
25         GPAD_GUIDE,
26         GPAD_START,
27         GPAD_LSTICK,
28         GPAD_RSTICK,
29         GPAD_L,
30         GPAD_R,
31         GPAD_UP,
32         GPAD_DOWN,
33         GPAD_LEFT,
34         GPAD_RIGHT,
35 };
36
37 bool app_init(int argc, char **argv);
38 void app_cleanup();
39
40 void app_display();
41 void app_reshape(int x, int y);
42
43 void app_keyboard(int key, bool pressed);
44 void app_mouse_button(int bn, bool pressed, int x, int y);
45 void app_mouse_motion(int x, int y);
46 void app_mouse_delta(int dx, int dy);
47
48 void app_gamepad_axis(int axis, float val);
49 void app_gamepad_button(int bn, bool pressed);
50
51 // the following functions are implemented by the backend (main.cc)
52 void app_quit();
53 void app_swap_buffers();
54 unsigned int app_get_modifiers();
55
56 void app_resize(int x, int y);
57 void app_fullscreen(bool fs);
58 void app_toggle_fullscreen();
59 bool app_is_fullscreen();
60 void app_grab_mouse(bool grab);
61 void app_toggle_grab_mouse();
62 bool app_is_mouse_grabbed();
63
64 #endif  // APP_H_