Debian Codegraph @

prboom2/src/dsda/game_controller.h

raw
1 //
2 // Copyright(C) 2022 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA Game Controller
16 //
17
18 #ifndef __DSDA_GAME_CONTROLLER__
19 #define __DSDA_GAME_CONTROLLER__
20
21 // Must match SDL
22 typedef enum {
23 DSDA_CONTROLLER_BUTTON_A,
24 DSDA_CONTROLLER_BUTTON_B,
25 DSDA_CONTROLLER_BUTTON_X,
26 DSDA_CONTROLLER_BUTTON_Y,
27 DSDA_CONTROLLER_BUTTON_BACK,
28 DSDA_CONTROLLER_BUTTON_GUIDE,
29 DSDA_CONTROLLER_BUTTON_START,
30 DSDA_CONTROLLER_BUTTON_LEFTSTICK,
31 DSDA_CONTROLLER_BUTTON_RIGHTSTICK,
32 DSDA_CONTROLLER_BUTTON_LEFTSHOULDER,
33 DSDA_CONTROLLER_BUTTON_RIGHTSHOULDER,
34 DSDA_CONTROLLER_BUTTON_DPAD_UP,
35 DSDA_CONTROLLER_BUTTON_DPAD_DOWN,
36 DSDA_CONTROLLER_BUTTON_DPAD_LEFT,
37 DSDA_CONTROLLER_BUTTON_DPAD_RIGHT,
38 DSDA_CONTROLLER_BUTTON_MISC1,
39 DSDA_CONTROLLER_BUTTON_PADDLE1,
40 DSDA_CONTROLLER_BUTTON_PADDLE2,
41 DSDA_CONTROLLER_BUTTON_PADDLE3,
42 DSDA_CONTROLLER_BUTTON_PADDLE4,
43 DSDA_CONTROLLER_BUTTON_TOUCHPAD,
44 DSDA_CONTROLLER_BUTTON_TRIGGERLEFT,
45 DSDA_CONTROLLER_BUTTON_TRIGGERRIGHT,
46 DSDA_CONTROLLER_BUTTON_MAX,
47 } dsda_game_controller_button_t;
48
49 const char* dsda_GameControllerButtonName(int button);
50 void dsda_PollGameController(void);
51 void dsda_PollGameControllerButtons(void);
52 void dsda_InitGameController(void);
53
54 #endif