Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_sysevents.c @ 1251:86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
updated project files, VS2005 support, VGA mode, more device support, etc,
etc, etc.
Fixes Bugzilla #47 and #28.
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 19 Jan 2006 08:43:00 +0000 |
parents | 51a8702d8ecd |
children | 7c7ddaf195bf |
comparison
equal
deleted
inserted
replaced
1250:a4d515d0fc3a | 1251:86d0d01290ea |
---|---|
45 #ifdef WMMSG_DEBUG | 45 #ifdef WMMSG_DEBUG |
46 #include "wmmsg.h" | 46 #include "wmmsg.h" |
47 #endif | 47 #endif |
48 | 48 |
49 #ifdef _WIN32_WCE | 49 #ifdef _WIN32_WCE |
50 #include "SDL_gapivideo.h" | |
50 #define NO_GETKEYBOARDSTATE | 51 #define NO_GETKEYBOARDSTATE |
51 #define NO_CHANGEDISPLAYSETTINGS | 52 #define NO_CHANGEDISPLAYSETTINGS |
52 #endif | 53 #endif |
53 | 54 |
54 /* The window we use for everything... */ | 55 /* The window we use for everything... */ |
96 if( !aygshell ) | 97 if( !aygshell ) |
97 aygshell = SDL_LoadObject("aygshell.dll"); | 98 aygshell = SDL_LoadObject("aygshell.dll"); |
98 if( aygshell ) | 99 if( aygshell ) |
99 { | 100 { |
100 SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen"); | 101 SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen"); |
102 } | |
103 } | |
104 | |
105 /* for gapi landscape mode */ | |
106 static void GapiTransform(SDL_ScreenOrientation rotate, char hires, Sint16 *x, Sint16 *y) { | |
107 Sint16 rotatedX; | |
108 Sint16 rotatedY; | |
109 | |
110 if (hires) { | |
111 *x = *x * 2; | |
112 *y = *y * 2; | |
113 } | |
114 | |
115 switch(rotate) { | |
116 case SDL_ORIENTATION_UP: | |
117 break; | |
118 case SDL_ORIENTATION_RIGHT: | |
119 if (!SDL_VideoSurface) | |
120 break; | |
121 rotatedX = SDL_VideoSurface->w - *y; | |
122 rotatedY = *x; | |
123 *x = rotatedX; | |
124 *y = rotatedY; | |
125 break; | |
126 case SDL_ORIENTATION_LEFT: | |
127 if (!SDL_VideoSurface) | |
128 break; | |
129 rotatedX = *y; | |
130 rotatedY = SDL_VideoSurface->h - *x; | |
131 *x = rotatedX; | |
132 *y = rotatedY; | |
133 break; | |
101 } | 134 } |
102 } | 135 } |
103 | 136 |
104 #endif | 137 #endif |
105 | 138 |
317 ClientToScreen(SDL_Window, ¢er); | 350 ClientToScreen(SDL_Window, ¢er); |
318 SetCursorPos(center.x, center.y); | 351 SetCursorPos(center.x, center.y); |
319 posted = SDL_PrivateMouseMotion(0, 1, x, y); | 352 posted = SDL_PrivateMouseMotion(0, 1, x, y); |
320 } | 353 } |
321 } else { | 354 } else { |
355 #ifdef _WIN32_WCE | |
356 if (SDL_VideoSurface) | |
357 GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y); | |
358 #endif | |
322 posted = SDL_PrivateMouseMotion(0, 0, x, y); | 359 posted = SDL_PrivateMouseMotion(0, 0, x, y); |
323 } | 360 } |
324 } | 361 } |
325 } | 362 } |
326 return(0); | 363 return(0); |
405 report internal mouse position if in relative mode */ | 442 report internal mouse position if in relative mode */ |
406 x = 0; y = 0; | 443 x = 0; y = 0; |
407 } else { | 444 } else { |
408 x = (Sint16)LOWORD(lParam); | 445 x = (Sint16)LOWORD(lParam); |
409 y = (Sint16)HIWORD(lParam); | 446 y = (Sint16)HIWORD(lParam); |
447 #ifdef _WIN32_WCE | |
448 if (SDL_VideoSurface) | |
449 GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y); | |
450 #endif | |
410 } | 451 } |
411 posted = SDL_PrivateMouseButton( | 452 posted = SDL_PrivateMouseButton( |
412 state, button, x, y); | 453 state, button, x, y); |
413 } | 454 } |
414 } | 455 } |