X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fapp.h;h=5e7554ff6828ae5f9706c981b3619697699f9f5f;hb=c77ee2a7256ffdb3aac158955178c372de349a1e;hp=0532be127b5f84d19868d8e905fb6d23a621271b;hpb=ab9fd0ac34f8107ff8067607fad229d08b1c3935;p=laserbrain_demo diff --git a/src/app.h b/src/app.h index 0532be1..5e7554f 100644 --- a/src/app.h +++ b/src/app.h @@ -1,11 +1,46 @@ #ifndef APP_H_ #define APP_H_ +#include "texture.h" +#include "scene.h" + extern long time_msec; extern int win_width, win_height; +extern float win_aspect; extern bool opt_gear_wireframe; +extern bool fb_srgb; + +extern TextureSet texman; +extern SceneSet sceneman; + +extern unsigned int sdr_ltmap, sdr_ltmap_notex; + +enum { + MOD_SHIFT = 1, + MOD_ALT = 2, + MOD_CTRL = 4 +}; -bool app_init(); +/* XXX make sure these match with SDL_GameControllerButton */ +enum { + GPAD_A, + GPAD_B, + GPAD_X, + GPAD_Y, + GPAD_BACK, + GPAD_GUIDE, + GPAD_START, + GPAD_LSTICK, + GPAD_RSTICK, + GPAD_L, + GPAD_R, + GPAD_UP, + GPAD_DOWN, + GPAD_LEFT, + GPAD_RIGHT, +}; + +bool app_init(int argc, char **argv); void app_cleanup(); void app_display(); @@ -14,9 +49,22 @@ void app_reshape(int x, int y); void app_keyboard(int key, bool pressed); void app_mouse_button(int bn, bool pressed, int x, int y); void app_mouse_motion(int x, int y); +void app_mouse_delta(int dx, int dy); + +void app_gamepad_axis(int axis, float val); +void app_gamepad_button(int bn, bool pressed); // the following functions are implemented by the backend (main.cc) void app_quit(); void app_swap_buffers(); +unsigned int app_get_modifiers(); + +void app_resize(int x, int y); +void app_fullscreen(bool fs); +void app_toggle_fullscreen(); +bool app_is_fullscreen(); +void app_grab_mouse(bool grab); +void app_toggle_grab_mouse(); +bool app_is_mouse_grabbed(); #endif // APP_H_