comparison src/SDL.c @ 2580:64fa227c01ce gsoc2008_force_feedback

Added the concept of the HelperWindow to help with DirectInput.
author Edgar Simo <bobbens@gmail.com>
date Mon, 04 Aug 2008 11:22:01 +0000
parents 3f73c88c9abb
children
comparison
equal deleted inserted replaced
2579:bd2a6c70cb29 2580:64fa227c01ce
48 #endif 48 #endif
49 #if !SDL_TIMERS_DISABLED 49 #if !SDL_TIMERS_DISABLED
50 extern void SDL_StartTicks(void); 50 extern void SDL_StartTicks(void);
51 extern int SDL_TimerInit(void); 51 extern int SDL_TimerInit(void);
52 extern void SDL_TimerQuit(void); 52 extern void SDL_TimerQuit(void);
53 #endif
54 #if defined(__WIN32__)
55 extern int SDL_HelperWindowCreate(void);
56 extern int SDL_HelperWindowDestroy(void);
53 #endif 57 #endif
54 58
55 /* The initialized subsystems */ 59 /* The initialized subsystems */
56 static Uint32 SDL_initialized = 0; 60 static Uint32 SDL_initialized = 0;
57 static Uint32 ticks_started = 0; 61 static Uint32 ticks_started = 0;
170 #endif 174 #endif
171 175
172 /* Clear the error message */ 176 /* Clear the error message */
173 SDL_ClearError(); 177 SDL_ClearError();
174 178
179 #if defined(__WIN32__)
180 if (SDL_HelperWindowCreate() < 0) {
181 return -1;
182 }
183 #endif
184
175 /* Initialize the desired subsystems */ 185 /* Initialize the desired subsystems */
176 if (SDL_InitSubSystem(flags) < 0) { 186 if (SDL_InitSubSystem(flags) < 0) {
177 return (-1); 187 return (-1);
178 } 188 }
179 189
240 { 250 {
241 /* Quit all subsystems */ 251 /* Quit all subsystems */
242 #ifdef DEBUG_BUILD 252 #ifdef DEBUG_BUILD
243 printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); 253 printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n");
244 fflush(stdout); 254 fflush(stdout);
255 #endif
256
257 #if defined(__WIN32__)
258 SDL_HelperWindowDestroy();
245 #endif 259 #endif
246 SDL_QuitSubSystem(SDL_INIT_EVERYTHING); 260 SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
247 261
248 #ifdef CHECK_LEAKS 262 #ifdef CHECK_LEAKS
249 #ifdef DEBUG_BUILD 263 #ifdef DEBUG_BUILD