Mercurial > sdl-ios-xcode
annotate src/joystick/iphoneos/SDLUIAccelerationDelegate.h @ 2439:78bddf0c0fa2 gsoc2008_iphone
Cleaned up code, added comments.
author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
---|---|
date | Fri, 15 Aug 2008 19:16:01 +0000 |
parents | 44fc2537ff9e |
children |
rev | line source |
---|---|
2439
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
1 /* |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
4 |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
7 License as published by the Free Software Foundation; either |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
9 |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
13 Lesser General Public License for more details. |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
14 |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
18 |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
19 Sam Lantinga |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
20 slouken@libsdl.org |
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
21 */ |
2362
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
22 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
23 #import <UIKit/UIKit.h> |
2439
78bddf0c0fa2
Cleaned up code, added comments.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
24 #import <SDL_types.h> |
2362
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
25 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
26 @interface SDLUIAccelerationDelegate: NSObject <UIAccelerometerDelegate> { |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
27 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
28 UIAccelerationValue x, y, z; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
29 BOOL isRunning; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
30 BOOL hasNewData; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
31 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
32 } |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
33 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
34 +(SDLUIAccelerationDelegate *)sharedDelegate; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
35 -(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
36 -(void)getLastOrientation:(Sint16 *)data; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
37 -(void)startup; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
38 -(void)shutdown; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
39 -(BOOL)isRunning; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
40 -(BOOL)hasNewData; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
41 -(void)setHasNewData:(BOOL)value; |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
42 |
44fc2537ff9e
These files contain the specification for a class which receives updates from the iPhone accelerometer. The class holds the accelerometer information, and is queried by SDL_sysjoystick.m.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
43 @end |