comparison src/video/windib/SDL_dibevents.c @ 1152:51a8702d8ecd

Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at activekitten.com.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 29 Sep 2005 09:43:00 +0000
parents a78acdd4967e
children 86d0d01290ea
comparison
equal deleted inserted replaced
1151:be9c9c8f6d53 1152:51a8702d8ecd
358 return(keysym); 358 return(keysym);
359 } 359 }
360 360
361 int DIB_CreateWindow(_THIS) 361 int DIB_CreateWindow(_THIS)
362 { 362 {
363 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
364 wchar_t *SDL_windowid_t;
365 #endif
366
363 #ifndef CS_BYTEALIGNCLIENT 367 #ifndef CS_BYTEALIGNCLIENT
364 #define CS_BYTEALIGNCLIENT 0 368 #define CS_BYTEALIGNCLIENT 0
365 #endif 369 #endif
366 SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0); 370 SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
367 if ( SDL_windowid ) { 371 if ( SDL_windowid ) {
372
373 // wince 2.1 does not have strtol
374 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
375 SDL_windowid_t = malloc((strlen(SDL_windowid) + 1) * sizeof(wchar_t));
376 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, SDL_windowid, -1, SDL_windowid_t, strlen(SDL_windowid) + 1);
377 SDL_Window = (HWND)wcstol(SDL_windowid_t, NULL, 0);
378 free(SDL_windowid_t);
379 #else
368 SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); 380 SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
381 #endif
369 if ( SDL_Window == NULL ) { 382 if ( SDL_Window == NULL ) {
370 SDL_SetError("Couldn't get user specified window"); 383 SDL_SetError("Couldn't get user specified window");
371 return(-1); 384 return(-1);
372 } 385 }
373 386