comparison src/video/wincommon/SDL_sysevents.c @ 1465:8dfa9a6d69a5

Updated WinCE support by Dmitry (with some tweaks) Converted the disk audio driver to SDL_RWops for portability
author Sam Lantinga <slouken@libsdl.org>
date Sat, 04 Mar 2006 08:24:35 +0000
parents 84de7511f79f
children 4aac8563c296
comparison
equal deleted inserted replaced
1464:af30090c0330 1465:8dfa9a6d69a5
38 #ifdef WMMSG_DEBUG 38 #ifdef WMMSG_DEBUG
39 #include "wmmsg.h" 39 #include "wmmsg.h"
40 #endif 40 #endif
41 41
42 #ifdef _WIN32_WCE 42 #ifdef _WIN32_WCE
43 #include "SDL_gapivideo.h" 43 #include "../gapi/SDL_gapivideo.h"
44
45 #define IsZoomed(HWND) 1
44 #define NO_GETKEYBOARDSTATE 46 #define NO_GETKEYBOARDSTATE
47 #if _WIN32_WCE < 420
45 #define NO_CHANGEDISPLAYSETTINGS 48 #define NO_CHANGEDISPLAYSETTINGS
49 #endif
46 #endif 50 #endif
47 51
48 /* The window we use for everything... */ 52 /* The window we use for everything... */
49 #ifdef _WIN32_WCE 53 #ifdef _WIN32_WCE
50 LPWSTR SDL_Appname = NULL; 54 LPWSTR SDL_Appname = NULL;
118 *y = *y * 2; 122 *y = *y * 2;
119 } 123 }
120 124
121 switch(rotate) { 125 switch(rotate) {
122 case SDL_ORIENTATION_UP: 126 case SDL_ORIENTATION_UP:
127 {
128 /* this code needs testing on a real device!
129 So it will be enabled later */
130 /*
131 #ifdef _WIN32_WCE
132 #if _WIN32_WCE >= 420
133 // test device orientation
134 // FIXME: do not check every mouse message
135 DEVMODE settings;
136 SDL_memset(&settings, 0, sizeof(DEVMODE));
137 settings.dmSize = sizeof(DEVMODE);
138 settings.dmFields = DM_DISPLAYORIENTATION;
139 ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
140 if( settings.dmOrientation == DMDO_90 )
141 {
142 rotatedX = SDL_VideoSurface->h - *x;
143 rotatedY = *y;
144 *x = rotatedX;
145 *y = rotatedY;
146 }
147 #endif
148 #endif */
149 }
123 break; 150 break;
124 case SDL_ORIENTATION_RIGHT: 151 case SDL_ORIENTATION_RIGHT:
125 if (!SDL_VideoSurface) 152 if (!SDL_VideoSurface)
126 break; 153 break;
127 rotatedX = SDL_VideoSurface->w - *y; 154 rotatedX = SDL_VideoSurface->w - *y;
142 169
143 #endif 170 #endif
144 171
145 static void SDL_RestoreGameMode(void) 172 static void SDL_RestoreGameMode(void)
146 { 173 {
174 ShowWindow(SDL_Window, SW_RESTORE);
147 #ifndef NO_CHANGEDISPLAYSETTINGS 175 #ifndef NO_CHANGEDISPLAYSETTINGS
148 ShowWindow(SDL_Window, SW_RESTORE); 176 #ifndef _WIN32_WCE
149 ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN); 177 ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
150 #endif 178 #endif
179 #endif /* NO_CHANGEDISPLAYSETTINGS */
151 } 180 }
152 static void SDL_RestoreDesktopMode(void) 181 static void SDL_RestoreDesktopMode(void)
153 { 182 {
183 ShowWindow(SDL_Window, SW_MINIMIZE);
154 #ifndef NO_CHANGEDISPLAYSETTINGS 184 #ifndef NO_CHANGEDISPLAYSETTINGS
155 ShowWindow(SDL_Window, SW_MINIMIZE); 185 #ifndef _WIN32_WCE
156 ChangeDisplaySettings(NULL, 0); 186 ChangeDisplaySettings(NULL, 0);
157 #endif 187 #endif
188 #endif /* NO_CHANGEDISPLAYSETTINGS */
158 } 189 }
159 190
160 #ifdef WM_MOUSELEAVE 191 #ifdef WM_MOUSELEAVE
161 /* 192 /*
162 Special code to handle mouse leave events - this sucks... 193 Special code to handle mouse leave events - this sucks...