fixed background loading of both textures and scenes
[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 /* XXX make sure these match with SDL_GameControllerButton */
25 enum {
26         GPAD_A,
27         GPAD_B,
28         GPAD_X,
29         GPAD_Y,
30         GPAD_BACK,
31         GPAD_GUIDE,
32         GPAD_START,
33         GPAD_LSTICK,
34         GPAD_RSTICK,
35         GPAD_L,
36         GPAD_R,
37         GPAD_UP,
38         GPAD_DOWN,
39         GPAD_LEFT,
40         GPAD_RIGHT,
41 };
42
43 bool app_init(int argc, char **argv);
44 void app_cleanup();
45
46 void app_display();
47 void app_reshape(int x, int y);
48
49 void app_keyboard(int key, bool pressed);
50 void app_mouse_button(int bn, bool pressed, int x, int y);
51 void app_mouse_motion(int x, int y);
52 void app_mouse_delta(int dx, int dy);
53
54 void app_gamepad_axis(int axis, float val);
55 void app_gamepad_button(int bn, bool pressed);
56
57 // the following functions are implemented by the backend (main.cc)
58 void app_quit();
59 void app_swap_buffers();
60 unsigned int app_get_modifiers();
61
62 void app_resize(int x, int y);
63 void app_fullscreen(bool fs);
64 void app_toggle_fullscreen();
65 bool app_is_fullscreen();
66 void app_grab_mouse(bool grab);
67 void app_toggle_grab_mouse();
68 bool app_is_mouse_grabbed();
69
70 #endif  // APP_H_