Mercurial > sdl-ios-xcode
annotate src/joystick/SDL_sysjoystick.h @ 1376:4a47f20705eb
I don't think we need aclocal anymore (comes from the automake package)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 19 Feb 2006 18:52:51 +0000 |
parents | 3692456e7b0f |
children | d910939febfa |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
5 This library is SDL_free software; you can redistribute it and/or |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 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 | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 /* This is the system specific header for the SDL joystick API */ | |
24 | |
25 #include "SDL_joystick.h" | |
26 | |
27 /* The SDL joystick structure */ | |
28 struct _SDL_Joystick { | |
29 Uint8 index; /* Device index */ | |
30 const char *name; /* Joystick name - system dependent */ | |
31 | |
32 int naxes; /* Number of axis controls on the joystick */ | |
33 Sint16 *axes; /* Current axis states */ | |
34 | |
35 int nhats; /* Number of hats on the joystick */ | |
36 Uint8 *hats; /* Current hat states */ | |
37 | |
38 int nballs; /* Number of trackballs on the joystick */ | |
39 struct balldelta { | |
40 int dx; | |
41 int dy; | |
42 } *balls; /* Current ball motion deltas */ | |
43 | |
44 int nbuttons; /* Number of buttons on the joystick */ | |
45 Uint8 *buttons; /* Current button states */ | |
46 | |
47 struct joystick_hwdata *hwdata; /* Driver dependent information */ | |
48 | |
49 int ref_count; /* Reference count for multiple opens */ | |
50 }; | |
51 | |
52 /* Function to scan the system for joysticks. | |
53 * Joystick 0 should be the system default joystick. | |
54 * This function should return the number of available joysticks, or -1 | |
55 * on an unrecoverable fatal error. | |
56 */ | |
57 extern int SDL_SYS_JoystickInit(void); | |
58 | |
59 /* Function to get the device-dependent name of a joystick */ | |
60 extern const char *SDL_SYS_JoystickName(int index); | |
61 | |
62 /* Function to open a joystick for use. | |
63 The joystick to open is specified by the index field of the joystick. | |
64 This should fill the nbuttons and naxes fields of the joystick structure. | |
65 It returns 0, or -1 if there is an error. | |
66 */ | |
67 extern int SDL_SYS_JoystickOpen(SDL_Joystick *joystick); | |
68 | |
69 /* Function to update the state of a joystick - called as a device poll. | |
70 * This function shouldn't update the joystick structure directly, | |
71 * but instead should call SDL_PrivateJoystick*() to deliver events | |
72 * and update joystick device state. | |
73 */ | |
74 extern void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick); | |
75 | |
76 /* Function to close a joystick after use */ | |
77 extern void SDL_SYS_JoystickClose(SDL_Joystick *joystick); | |
78 | |
79 /* Function to perform any system-specific joystick related cleanup */ | |
80 extern void SDL_SYS_JoystickQuit(void); | |
81 |