comparison test/testjoystick.c @ 2765:f55c87ae336b

Final merge of Google Summer of Code 2008 work... Bring SDL to iPhone and iPod Touch by Holmes Futrell, mentored by Sam Lantinga
author Sam Lantinga <slouken@libsdl.org>
date Sat, 04 Oct 2008 06:46:59 +0000
parents 6280c111ee80
children
comparison
equal deleted inserted replaced
2764:4868c0df2e83 2765:f55c87ae336b
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "SDL.h" 8 #include "SDL.h"
9 9
10 #ifdef __IPHONEOS__
11 #define SCREEN_WIDTH 320
12 #define SCREEN_HEIGHT 480
13 #else
10 #define SCREEN_WIDTH 640 14 #define SCREEN_WIDTH 640
11 #define SCREEN_HEIGHT 480 15 #define SCREEN_HEIGHT 480
16 #endif
12 17
13 void 18 void
14 WatchJoystick(SDL_Joystick * joystick) 19 WatchJoystick(SDL_Joystick * joystick)
15 { 20 {
16 SDL_Surface *screen; 21 SDL_Surface *screen;
127 if (y < 0) { 132 if (y < 0) {
128 y = 0; 133 y = 0;
129 } else if (y > (SCREEN_HEIGHT - 16)) { 134 } else if (y > (SCREEN_HEIGHT - 16)) {
130 y = SCREEN_HEIGHT - 16; 135 y = SCREEN_HEIGHT - 16;
131 } 136 }
137
132 axis_area[i][draw].x = (Sint16) x; 138 axis_area[i][draw].x = (Sint16) x;
133 axis_area[i][draw].y = (Sint16) y; 139 axis_area[i][draw].y = (Sint16) y;
134 axis_area[i][draw].w = 16; 140 axis_area[i][draw].w = 16;
135 axis_area[i][draw].h = 16; 141 axis_area[i][draw].h = 16;
136 SDL_FillRect(screen, &axis_area[i][draw], 0xFFFF); 142 SDL_FillRect(screen, &axis_area[i][draw], 0xFFFF);