Mercurial > sdl-ios-xcode
annotate src/joystick/iphoneos/SDLUIAccelerationDelegate.m @ 2430:166821fa1591 gsoc2008_iphone
A version of testgl2 written using OpenGL ES calls. Necessary because there's no glBegin/glEnd, etc.
author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
---|---|
date | Fri, 15 Aug 2008 00:54:21 +0000 |
parents | 32b9909db651 |
children | 78bddf0c0fa2 |
rev | line source |
---|---|
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
|
1 // |
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
|
2 // SDLUIAccelerationDelegate.m |
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
|
3 // iPodSDL |
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
|
4 // |
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
|
5 // Created by Holmes Futrell on 6/21/08. |
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
|
6 // Copyright 2008 __MyCompanyName__. All rights reserved. |
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
|
7 // |
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
|
8 |
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
|
9 #import "SDLUIAccelerationDelegate.h" |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
10 #import "../../../include/SDL_config_iphoneos.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
|
11 |
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
|
12 static SDLUIAccelerationDelegate *sharedDelegate=nil; |
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
|
13 |
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
|
14 @implementation SDLUIAccelerationDelegate |
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
|
15 |
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
|
16 +(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
|
17 if (sharedDelegate == nil) { |
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
|
18 sharedDelegate = [[SDLUIAccelerationDelegate alloc] init]; |
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
|
19 } |
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
|
20 return 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
|
21 } |
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 -(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
|
24 |
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 x = acceleration.x; |
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 y = acceleration.y; |
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 z = acceleration.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
|
28 |
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 hasNewData = YES; |
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 //timestamp = acceleration.timestamp; |
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 -(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
|
35 |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
36 #define MAX_SINT16 0x7FFF |
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
|
37 |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
38 if (x > SDL_IPHONE_MAX_GFORCE) x = SDL_IPHONE_MAX_GFORCE; |
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
39 else if (x < -SDL_IPHONE_MAX_GFORCE) x = -SDL_IPHONE_MAX_GFORCE; |
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
|
40 |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
41 if (y > SDL_IPHONE_MAX_GFORCE) y = SDL_IPHONE_MAX_GFORCE; |
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
42 else if (y < -SDL_IPHONE_MAX_GFORCE) y = -SDL_IPHONE_MAX_GFORCE; |
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
|
43 |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
44 if (z > SDL_IPHONE_MAX_GFORCE) z = SDL_IPHONE_MAX_GFORCE; |
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
45 else if (z < -SDL_IPHONE_MAX_GFORCE) z = -SDL_IPHONE_MAX_GFORCE; |
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
|
46 |
2427
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
47 data[0] = (x / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; |
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
48 data[1] = (y / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; |
32b9909db651
changed macro MAX_G_FORCE to SDL_IPHONE_MAX_GFORCE and moved it to the SDL_config_iphoneos.h file. This should allow users to convert between the Sint16 returned by polling the joystick and units of g-force, which better describe what is going on with the iPhone (and are what the iPhone OS actually gives you). This conversion wouldn't be necessary except that we'd need floating point to store everything as g-force.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2362
diff
changeset
|
49 data[2] = (z / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; |
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
|
50 |
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
|
51 } |
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
|
52 |
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
|
53 -(id)init { |
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
|
54 |
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
|
55 self = [super init]; |
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
|
56 x = y = z = 0.0; |
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
|
57 return self; |
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
|
58 |
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
|
59 } |
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
|
60 |
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
|
61 -(void)dealloc { |
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
|
62 sharedDelegate = nil; |
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
|
63 [super dealloc]; |
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
|
64 } |
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
|
65 |
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
|
66 -(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
|
67 [UIAccelerometer sharedAccelerometer].delegate = self; |
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
|
68 isRunning = YES; |
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
|
69 } |
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
|
70 |
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
|
71 -(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
|
72 [UIAccelerometer sharedAccelerometer].delegate = nil; |
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
|
73 isRunning = NO; |
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
|
74 } |
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
|
75 |
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
|
76 -(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
|
77 return 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
|
78 } |
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
|
79 |
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
|
80 -(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
|
81 return 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
|
82 } |
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
|
83 |
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
|
84 -(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
|
85 hasNewData = 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
|
86 } |
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
|
87 |
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
|
88 @end |