Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32video.c @ 3168:6338b7f2d024
Hi,
I have prepared a set of patches to readd WindowsCE support to SDL 1.3.
I've created a new GAPI/Rawframebuffer and a DirectDraw renderer.
Both renderers are work in progress and there are several unimplemented
cases. (Notably
RenderLine/RenderPoint/RenderFill/QueryTexturePixels/UpdateTexture and
texture blending )
Nevertheless I am successfully using these renderers together with the
SDL software renderer. (On most devices the SDL software renderer will
be much faster as there are only badly optimized vendor drivers available)
I send these patches now in this unpolished state because there seems to
be some interest in win ce and someone has to start supporting SDL 1.3
Now on to the patches:
wince_events_window_fixes.patch
fixes some wince incompatibilities and adds fullscreen support via
SHFullScreen. NOTE: This patch shouldn't have any side effects on
Windows, but I have NOT tested it on Windows, so please double-check.
This patch doesn't dependent on the following ones.
wince_renderers_system.patch
This patch does all necessary modifications to the SDL system.
- it adds the renderers to the configure system
- it adds the renderers to win32video
SDL_ceddrawrender.c
SDL_ceddrawrender.h
SDL_gapirender_c.h
SDL_gapirender.c
SDL_gapirender.h
these files add the new render drivers and should be placed in
src/video/win32
Some notes to people who want to test this:
- I have only compiled sdl with ming32ce, so the VisualC files are not
up to date
- As mingw32ce has no ddraw.h this file must be taken from the MS SDK
and modified to work with gcc
- I had to modify line 2611 in configure.in to
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer
-Wl,--image-base -Wl,0x10000"
otherwise GetCPinfo wouldn't link. If someone knows whats causing this
I'd be happy to hear about it.
It would be great if these patches could make their way into SVN as this
would make collaboration much much easier.
I'm out of office for the next week and therefore will be unavailable
via email.
Regards
Stefan
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 07 Jun 2009 02:44:46 +0000 |
parents | 089a77aebb7d |
children | 76f9b76ddf0f |
comparison
equal
deleted
inserted
replaced
3167:0c85abc61e47 | 3168:6338b7f2d024 |
---|---|
58 if (data->d3d) { | 58 if (data->d3d) { |
59 IDirect3D9_Release(data->d3d); | 59 IDirect3D9_Release(data->d3d); |
60 FreeLibrary(data->d3dDLL); | 60 FreeLibrary(data->d3dDLL); |
61 } | 61 } |
62 #endif | 62 #endif |
63 #if SDL_VIDEO_RENDER_DDRAW | |
64 if (data->ddraw) { | |
65 data->ddraw->lpVtbl->Release(data->ddraw); | |
66 FreeLibrary(data->ddrawDLL); | |
67 } | |
68 #endif | |
63 if (data->wintabDLL) { | 69 if (data->wintabDLL) { |
64 FreeLibrary(data->wintabDLL); | 70 FreeLibrary(data->wintabDLL); |
65 } | 71 } |
66 SDL_free(device->driverdata); | 72 SDL_free(device->driverdata); |
67 SDL_free(device); | 73 SDL_free(device); |
104 FreeLibrary(data->d3dDLL); | 110 FreeLibrary(data->d3dDLL); |
105 data->d3dDLL = NULL; | 111 data->d3dDLL = NULL; |
106 } | 112 } |
107 } | 113 } |
108 #endif /* SDL_VIDEO_RENDER_D3D */ | 114 #endif /* SDL_VIDEO_RENDER_D3D */ |
115 #if SDL_VIDEO_RENDER_DDRAW | |
116 data->ddrawDLL = LoadLibrary(TEXT("ddraw.dll")); | |
117 if (data->ddrawDLL) { | |
118 IDirectDraw *(WINAPI * DDCreate) (GUID FAR * lpGUID, | |
119 LPDIRECTDRAW FAR * lplpDD, | |
120 IUnknown FAR * pUnkOuter); | |
121 | |
122 DDCreate = | |
123 (IDirectDraw * | |
124 (WINAPI *) (GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *)) | |
125 GetProcAddress(data->ddrawDLL, TEXT("DirectDrawCreate")); | |
126 if (!DDCreate || DDCreate(NULL, &data->ddraw, NULL) != DD_OK) { | |
127 FreeLibrary(data->ddrawDLL); | |
128 data->ddrawDLL = NULL; | |
129 data->ddraw = NULL; | |
130 } | |
131 } | |
132 #endif /* SDL_VIDEO_RENDER_DDRAW */ | |
109 | 133 |
110 data->wintabDLL = LoadLibrary(TEXT("WINTAB32.DLL")); | 134 data->wintabDLL = LoadLibrary(TEXT("WINTAB32.DLL")); |
111 if (data->wintabDLL) { | 135 if (data->wintabDLL) { |
112 #define PROCNAME(X) #X | 136 #define PROCNAME(X) #X |
113 data->WTInfoA = | 137 data->WTInfoA = |
186 WIN_InitModes(_this); | 210 WIN_InitModes(_this); |
187 | 211 |
188 #if SDL_VIDEO_RENDER_D3D | 212 #if SDL_VIDEO_RENDER_D3D |
189 D3D_AddRenderDriver(_this); | 213 D3D_AddRenderDriver(_this); |
190 #endif | 214 #endif |
215 #if SDL_VIDEO_RENDER_DDRAW | |
216 DDRAW_AddRenderDriver(_this); | |
217 #endif | |
191 #if SDL_VIDEO_RENDER_GDI | 218 #if SDL_VIDEO_RENDER_GDI |
192 GDI_AddRenderDriver(_this); | 219 GDI_AddRenderDriver(_this); |
220 #endif | |
221 #if SDL_VIDEO_RENDER_GAPI | |
222 GAPI_AddRenderDriver(_this); | |
193 #endif | 223 #endif |
194 | 224 |
195 g_hCtx = SDL_malloc(sizeof(HCTX)); | 225 g_hCtx = SDL_malloc(sizeof(HCTX)); |
196 WIN_InitKeyboard(_this); | 226 WIN_InitKeyboard(_this); |
197 WIN_InitMouse(_this); | 227 WIN_InitMouse(_this); |