annotate src/joystick/iphoneos/SDL_sysjoystick.m @ 2384:6a946f3155d8 gsoc2008_iphone

Drum kit demo (SDL_mixer)
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Fri, 18 Jul 2008 20:51:59 +0000
parents 49b243db2e04
children
rev   line source
2348
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
1 /*
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
4
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
9
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
13 Lesser General Public License for more details.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
14
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
18
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
19 Sam Lantinga
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
20 slouken@libsdl.org
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
21 */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22 #include "SDL_config.h"
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24 /* This is the system specific header for the SDL joystick API */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26 #include "SDL_joystick.h"
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27 #include "../SDL_sysjoystick.h"
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28 #include "../SDL_joystick_c.h"
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29 #import "SDLUIAccelerationDelegate.h"
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31 const char *accelerometerName = "iPhone accelerometer";
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33 /* Function to scan the system for joysticks.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34 * This function should set SDL_numjoysticks to the number of available
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 * joysticks. Joystick 0 should be the system default joystick.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36 * It should return 0, or -1 on an unrecoverable fatal error.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37 */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38 int
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 SDL_SYS_JoystickInit(void)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41 SDL_numjoysticks = 1;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42 return (1);
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45 /* Function to get the device-dependent name of a joystick */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
46 const char *
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
47 SDL_SYS_JoystickName(int index)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
48 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
49 switch(index) {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50 case 0:
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51 return accelerometerName;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 default:
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 SDL_SetError("No joystick available with that index");
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54 return NULL;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
56 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58 /* Function to open a joystick for use.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59 The joystick to open is specified by the index field of the joystick.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60 This should fill the nbuttons and naxes fields of the joystick structure.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61 It returns 0, or -1 if there is an error.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62 */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 int
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
64 SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
65 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
66 if (joystick->index == 0) {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
67 joystick->naxes = 3;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
68 joystick->nhats = 0;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
69 joystick->nballs = 0;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
70 joystick->nbuttons = 0;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
71 joystick->name = accelerometerName;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
72 [[SDLUIAccelerationDelegate sharedDelegate] startup];
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
73 return 0;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
74 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
75 else {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
76 SDL_SetError("No joystick available with that index");
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
77 return (-1);
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
78 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
79
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
80 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
81
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
82 /* Function to update the state of a joystick - called as a device poll.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
83 * This function shouldn't update the joystick structure directly,
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
84 * but instead should call SDL_PrivateJoystick*() to deliver events
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
85 * and update joystick device state.
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
86 */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
87 void
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
88 SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
89 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
90
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
91 Sint16 orientation[3];
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
92
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
93 if ([[SDLUIAccelerationDelegate sharedDelegate] hasNewData]) {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
94
2363
49b243db2e04 Fixed a bug where SDL_SYS_JoystickUpdate would send update events even when the accelerometer delegate hadn't received new information from the hardware.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2348
diff changeset
95 [[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation];
2348
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
96 [[SDLUIAccelerationDelegate sharedDelegate] setHasNewData: NO];
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
97
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
98 SDL_PrivateJoystickAxis(joystick, 0, orientation[0]);
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
99 SDL_PrivateJoystickAxis(joystick, 1, orientation[1]);
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
100 SDL_PrivateJoystickAxis(joystick, 2, orientation[2]);
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
101
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
102 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
103
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
104 return;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
105 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
106
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
107 /* Function to close a joystick after use */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
108 void
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
109 SDL_SYS_JoystickClose(SDL_Joystick * joystick)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
110 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
111 if (joystick->index == 0 && [[SDLUIAccelerationDelegate sharedDelegate] isRunning]) {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
112 [[SDLUIAccelerationDelegate sharedDelegate] shutdown];
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
113 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
114 SDL_SetError("No joystick open with that index");
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
115
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
116 return;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
117 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
118
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
119 /* Function to perform any system-specific joystick related cleanup */
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
120 void
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
121 SDL_SYS_JoystickQuit(void)
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
122 {
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
123 return;
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
124 }
dd32c95434f4 Just the sysjoystick file for the iPhone accelerometer. It doesn't reveal anything under NDA, but I just wanted to make sure that adding files to the repository is working under XCode right now.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
125 /* vi: set ts=4 sw=4 expandtab: */