playable with a gamepad
[vrtris] / src / game.h
index a3455f0..2625f1a 100644 (file)
@@ -7,6 +7,11 @@ int vp_width, vp_height;       /* viewport size differs from win size during VR eye re
 float win_aspect;
 int fb_srgb;
 
+float joy_axis[3];
+unsigned int joy_bnstate;
+
+float view_matrix[16], proj_matrix[16];
+
 enum {
        MOD_SHIFT       = 1,
        MOD_ALT         = 2,
@@ -54,32 +59,44 @@ enum {
        GPAD_UP,
        GPAD_DOWN,
        GPAD_LEFT,
-       GPAD_RIGHT,
+       GPAD_RIGHT
+};
+
+/* XXX make sure these match with SDL_GameControllerAxis */
+enum {
+       GPAD_LSTICK_X,
+       GPAD_LSTICK_Y,
+       GPAD_RSTICK_X,
+       GPAD_RSTICK_Y,
+       GPAD_LTRIG,
+       GPAD_RTRIG
 };
 
 int game_init(int argc, char **argv);
-void game_cleanup();
+void game_cleanup(void);
 
-void game_display();
+void game_display(void);
 void game_reshape(int x, int y);
 
 void game_keyboard(int key, int pressed);
 void game_mouse_button(int bn, int pressed, int x, int y);
 void game_mouse_motion(int x, int y);
-void game_mouse_delta(int dx, int dy);
 void game_mouse_wheel(int dir);
 
 void game_gamepad_axis(int axis, float val);
 void game_gamepad_button(int bn, int pressed);
 
 /* the following functions are implemented by the backend (main.c) */
-void game_quit();
-void game_swap_buffers();
-unsigned int game_get_modifiers();
+void game_quit(void);
+void game_swap_buffers(void);
+unsigned int game_get_modifiers(void);
 
 void game_resize(int x, int y);
 void game_fullscreen(int fs);
-void game_toggle_fullscreen();
-int game_is_fullscreen();
+void game_toggle_fullscreen(void);
+int game_is_fullscreen(void);
+
+int game_num_joy_axes(void);
+int game_num_joy_buttons(void);
 
 #endif // GAME_H_