comparison src/SDL.c @ 2674:f1d07ba2e275 gsoc2008_nds

Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
author Darren Alton <dalton@stevens.edu>
date Mon, 23 Jun 2008 11:55:26 +0000
parents 8f1ab2f7c722
children 3895761db26a
comparison
equal deleted inserted replaced
2673:24a6b3588eac 2674:f1d07ba2e275
35 35
36 /* Initialization/Cleanup routines */ 36 /* Initialization/Cleanup routines */
37 #if !SDL_JOYSTICK_DISABLED 37 #if !SDL_JOYSTICK_DISABLED
38 extern int SDL_JoystickInit(void); 38 extern int SDL_JoystickInit(void);
39 extern void SDL_JoystickQuit(void); 39 extern void SDL_JoystickQuit(void);
40 #endif
41 #if !SDL_TOUCHSCREEN_DISABLED
42 extern int SDL_TouchscreenInit(void);
43 extern void SDL_TouchscreenQuit(void);
40 #endif 44 #endif
41 #if !SDL_CDROM_DISABLED 45 #if !SDL_CDROM_DISABLED
42 extern int SDL_CDROMInit(void); 46 extern int SDL_CDROMInit(void);
43 extern void SDL_CDROMQuit(void); 47 extern void SDL_CDROMQuit(void);
44 #endif 48 #endif
121 SDL_SetError("SDL not built with joystick support"); 125 SDL_SetError("SDL not built with joystick support");
122 return (-1); 126 return (-1);
123 } 127 }
124 #endif 128 #endif
125 129
130 #if !SDL_TOUCHSCREEN_DISABLED
131 /* Initialize the touchscreen subsystem */
132 if ((flags & SDL_INIT_TOUCHSCREEN) && !(SDL_initialized & SDL_INIT_TOUCHSCREEN)) {
133 if (SDL_TouchscreenInit() < 0) {
134 return (-1);
135 }
136 SDL_initialized |= SDL_INIT_TOUCHSCREEN;
137 }
138 #else
139 if (flags & SDL_INIT_TOUCHSCREEN) {
140 SDL_SetError("SDL not built with touchscreen support");
141 return (-1);
142 }
143 #endif
144
126 #if !SDL_CDROM_DISABLED 145 #if !SDL_CDROM_DISABLED
127 /* Initialize the CD-ROM subsystem */ 146 /* Initialize the CD-ROM subsystem */
128 if ((flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM)) { 147 if ((flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM)) {
129 if (SDL_CDROMInit() < 0) { 148 if (SDL_CDROMInit() < 0) {
130 return (-1); 149 return (-1);
176 #endif 195 #endif
177 #if !SDL_JOYSTICK_DISABLED 196 #if !SDL_JOYSTICK_DISABLED
178 if ((flags & SDL_initialized & SDL_INIT_JOYSTICK)) { 197 if ((flags & SDL_initialized & SDL_INIT_JOYSTICK)) {
179 SDL_JoystickQuit(); 198 SDL_JoystickQuit();
180 SDL_initialized &= ~SDL_INIT_JOYSTICK; 199 SDL_initialized &= ~SDL_INIT_JOYSTICK;
200 }
201 #endif
202 #if !SDL_TOUCHSCREEN_DISABLED
203 if ((flags & SDL_initialized & SDL_INIT_TOUCHSCREEN)) {
204 SDL_TouchscreenQuit();
205 SDL_initialized &= ~SDL_INIT_TOUCHSCREEN;
181 } 206 }
182 #endif 207 #endif
183 #if !SDL_TIMERS_DISABLED 208 #if !SDL_TIMERS_DISABLED
184 if ((flags & SDL_initialized & SDL_INIT_TIMER)) { 209 if ((flags & SDL_initialized & SDL_INIT_TIMER)) {
185 SDL_TimerQuit(); 210 SDL_TimerQuit();