|
1 /* |
|
2 SDL - Simple DirectMedia Layer |
|
3 Copyright (C) 1997-2006 Sam Lantinga |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Lesser General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2.1 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Lesser General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Lesser General Public |
|
16 License along with this library; if not, write to the Free Software |
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
18 |
|
19 Sam Lantinga |
|
20 slouken@libsdl.org |
|
21 */ |
|
22 #include "SDL_config.h" |
|
23 |
|
24 #if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED) |
|
25 |
|
26 /* This is the system specific header for the SDL joystick API */ |
|
27 |
|
28 #include "SDL_joystick.h" |
|
29 #include "../SDL_sysjoystick.h" |
|
30 #include "../SDL_joystick_c.h" |
|
31 |
|
32 /* Function to scan the system for joysticks. |
|
33 * This function should set SDL_numjoysticks to the number of available |
|
34 * joysticks. Joystick 0 should be the system default joystick. |
|
35 * It should return 0, or -1 on an unrecoverable fatal error. |
|
36 */ |
|
37 int SDL_SYS_JoystickInit(void) |
|
38 { |
|
39 SDL_numjoysticks = 0; |
|
40 return(0); |
|
41 } |
|
42 |
|
43 /* Function to get the device-dependent name of a joystick */ |
|
44 const char *SDL_SYS_JoystickName(int index) |
|
45 { |
|
46 SDL_SetError("Logic error: No joysticks available"); |
|
47 return(NULL); |
|
48 } |
|
49 |
|
50 /* Function to open a joystick for use. |
|
51 The joystick to open is specified by the index field of the joystick. |
|
52 This should fill the nbuttons and naxes fields of the joystick structure. |
|
53 It returns 0, or -1 if there is an error. |
|
54 */ |
|
55 int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) |
|
56 { |
|
57 SDL_SetError("Logic error: No joysticks available"); |
|
58 return(-1); |
|
59 } |
|
60 |
|
61 /* Function to update the state of a joystick - called as a device poll. |
|
62 * This function shouldn't update the joystick structure directly, |
|
63 * but instead should call SDL_PrivateJoystick*() to deliver events |
|
64 * and update joystick device state. |
|
65 */ |
|
66 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) |
|
67 { |
|
68 return; |
|
69 } |
|
70 |
|
71 /* Function to close a joystick after use */ |
|
72 void SDL_SYS_JoystickClose(SDL_Joystick *joystick) |
|
73 { |
|
74 return; |
|
75 } |
|
76 |
|
77 /* Function to perform any system-specific joystick related cleanup */ |
|
78 void SDL_SYS_JoystickQuit(void) |
|
79 { |
|
80 return; |
|
81 } |
|
82 |
|
83 #endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */ |