comparison src/video/win32/SDL_win32video.c @ 4569:e1664f94f026

Andrey A. I made a video driver GAPI/RAW for WinCE (SDL-1.3). RAW mode has a priority, and also, GAPI mode works with environment "SDL_VIDEO_RENDERER=gapi" and for RAW mode "SDL_VIDEO_RENDERER=raw". I checked the work on the screens of VGA, WVGA, QVGA, WQVGA, HVGA, + tested all modes with WindowsMobile Emulator. Also, correctly draws the pointer position and the scale of the pointer for VGA/WVGA modes, correctly draws top left position for DM orientation screen, and portrait/landscape/square geometry the screen also correct. Also, I added a small fix for GDI fullscreen mode. Patch for latest revision SDL-1.3 in an attachment. Also added small path for mingw32ce build.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 27 Jul 2010 21:31:28 -0700
parents 9faebccfefb3
children 518d1679d2d0
comparison
equal deleted inserted replaced
4568:25b9cd8bdc30 4569:e1664f94f026
28 #include "../SDL_pixels_c.h" 28 #include "../SDL_pixels_c.h"
29 29
30 #include "SDL_win32video.h" 30 #include "SDL_win32video.h"
31 #include "SDL_d3drender.h" 31 #include "SDL_d3drender.h"
32 #include "SDL_gdirender.h" 32 #include "SDL_gdirender.h"
33 #include "SDL_gapirender.h"
33 34
34 /* Initialization/Query functions */ 35 /* Initialization/Query functions */
35 static int WIN_VideoInit(_THIS); 36 static int WIN_VideoInit(_THIS);
36 static void WIN_VideoQuit(_THIS); 37 static void WIN_VideoQuit(_THIS);
37 38
46 message = WIN_StringToUTF8(buffer); 47 message = WIN_StringToUTF8(buffer);
47 SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message); 48 SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
48 SDL_free(message); 49 SDL_free(message);
49 } 50 }
50 51
52
51 /* WIN32 driver bootstrap functions */ 53 /* WIN32 driver bootstrap functions */
52 54
53 static int 55 static int
54 WIN_Available(void) 56 WIN_Available(void)
55 { 57 {
70 #endif 72 #endif
71 #if SDL_VIDEO_RENDER_DDRAW 73 #if SDL_VIDEO_RENDER_DDRAW
72 if (data->ddraw) { 74 if (data->ddraw) {
73 data->ddraw->lpVtbl->Release(data->ddraw); 75 data->ddraw->lpVtbl->Release(data->ddraw);
74 FreeLibrary(data->ddrawDLL); 76 FreeLibrary(data->ddrawDLL);
77 }
78 #endif
79 #ifdef _WIN32_WCE
80 if(data->hAygShell) {
81 FreeLibrary(data->hAygShell);
75 } 82 }
76 #endif 83 #endif
77 SDL_free(device->driverdata); 84 SDL_free(device->driverdata);
78 SDL_free(device); 85 SDL_free(device);
79 } 86 }
135 data->ddrawDLL = NULL; 142 data->ddrawDLL = NULL;
136 data->ddraw = NULL; 143 data->ddraw = NULL;
137 } 144 }
138 } 145 }
139 #endif /* SDL_VIDEO_RENDER_DDRAW */ 146 #endif /* SDL_VIDEO_RENDER_DDRAW */
147
148 #ifdef _WIN32_WCE
149 data->hAygShell = LoadLibrary(TEXT("\\windows\\aygshell.dll"));
150 if(0 == data->hAygShell)
151 data->hAygShell = LoadLibrary(TEXT("aygshell.dll"));
152 data->SHFullScreen = (0 != data->hAygShell ?
153 (PFNSHFullScreen) GetProcAddress(data->hAygShell, TEXT("SHFullScreen")) : 0);
154 data->CoordTransform = NULL;
155 #endif
140 156
141 /* Set the function pointers */ 157 /* Set the function pointers */
142 device->VideoInit = WIN_VideoInit; 158 device->VideoInit = WIN_VideoInit;
143 device->VideoQuit = WIN_VideoQuit; 159 device->VideoQuit = WIN_VideoQuit;
144 device->GetDisplayBounds = WIN_GetDisplayBounds; 160 device->GetDisplayBounds = WIN_GetDisplayBounds;
184 200
185 return device; 201 return device;
186 } 202 }
187 203
188 VideoBootStrap WIN32_bootstrap = { 204 VideoBootStrap WIN32_bootstrap = {
205 #ifdef _WIN32_WCE
206 "wince", "SDL WinCE video driver", WINCE_Available, WIN_CreateDevice
207 #else
189 "win32", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice 208 "win32", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice
209 #endif
190 }; 210 };
191
192 211
193 int 212 int
194 WIN_VideoInit(_THIS) 213 WIN_VideoInit(_THIS)
195 { 214 {
196 if (WIN_InitModes(_this) < 0) { 215 if (WIN_InitModes(_this) < 0) {
205 #endif 224 #endif
206 #if SDL_VIDEO_RENDER_GDI 225 #if SDL_VIDEO_RENDER_GDI
207 GDI_AddRenderDriver(_this); 226 GDI_AddRenderDriver(_this);
208 #endif 227 #endif
209 #if SDL_VIDEO_RENDER_GAPI 228 #if SDL_VIDEO_RENDER_GAPI
210 GAPI_AddRenderDriver(_this); 229 WINCE_AddRenderDriver(_this);
211 #endif 230 #endif
212 231
213 WIN_InitKeyboard(_this); 232 WIN_InitKeyboard(_this);
214 WIN_InitMouse(_this); 233 WIN_InitMouse(_this);
215 234