Removed more partially functional renderers
authorSam Lantinga
Mon, 31 Jan 2011 22:53:45 -0800
changeset 513957851a238c8f
parent 5138 da10636e5eca
child 5140 e743b9c3f6d6
Removed more partially functional renderers
configure.in
include/SDL_config.h.in
include/SDL_config_windows.h
src/video/windows/SDL_ceddrawrender.c
src/video/windows/SDL_ceddrawrender.h
src/video/windows/SDL_gapirender.c
src/video/windows/SDL_gapirender.h
src/video/windows/SDL_gapirender_c.h
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowsvideo.h
src/video/windows/SDL_windowswindow.c
     1.1 --- a/configure.in	Mon Jan 31 22:44:43 2011 -0800
     1.2 +++ b/configure.in	Mon Jan 31 22:53:45 2011 -0800
     1.3 @@ -2345,18 +2345,6 @@
     1.4              AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS)
     1.5              SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
     1.6              have_video=yes
     1.7 -            AC_ARG_ENABLE(render-gapi,
     1.8 -AC_HELP_STRING([--enable-render-gapi], [enable the GAPI/RAWFRAMEBUFFER render driver [[default=yes]]]),
     1.9 -                                , enable_render_gapi=yes)
    1.10 -            if test x$enable_render_gapi = xyes -a x$have_wince = xyes; then
    1.11 -                AC_DEFINE(SDL_VIDEO_RENDER_GAPI)
    1.12 -            fi
    1.13 -            AC_ARG_ENABLE(render-ddraw,
    1.14 -AC_HELP_STRING([--enable-render-ddraw], [enable the Mobile DirectDraw render driver [[default=yes]]]),
    1.15 -                                , enable_render_ddraw=yes)
    1.16 -            if test x$enable_render_ddraw = xyes -a x$have_wince = xyes -a x$have_ddraw = xyes; then
    1.17 -                AC_DEFINE(SDL_VIDEO_RENDER_DDRAW)
    1.18 -            fi
    1.19              AC_ARG_ENABLE(render-d3d,
    1.20  AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
    1.21                                  , enable_render_d3d=yes)
     2.1 --- a/include/SDL_config.h.in	Mon Jan 31 22:44:43 2011 -0800
     2.2 +++ b/include/SDL_config.h.in	Mon Jan 31 22:53:45 2011 -0800
     2.3 @@ -287,8 +287,6 @@
     2.4  #undef SDL_VIDEO_RENDER_D3D
     2.5  #undef SDL_VIDEO_RENDER_OGL
     2.6  #undef SDL_VIDEO_RENDER_OGL_ES
     2.7 -#undef SDL_VIDEO_RENDER_GAPI
     2.8 -#undef SDL_VIDEO_RENDER_DDRAW
     2.9  
    2.10  /* Enable OpenGL support */
    2.11  #undef SDL_VIDEO_OPENGL
     3.1 --- a/include/SDL_config_windows.h	Mon Jan 31 22:44:43 2011 -0800
     3.2 +++ b/include/SDL_config_windows.h	Mon Jan 31 22:53:45 2011 -0800
     3.3 @@ -178,11 +178,7 @@
     3.4  #define SDL_VIDEO_DRIVER_DUMMY	1
     3.5  #define SDL_VIDEO_DRIVER_WINDOWS	1
     3.6  
     3.7 -#ifdef _WIN32_WCE
     3.8 -#ifndef SDL_VIDEO_RENDER_GAPI
     3.9 -#define SDL_VIDEO_RENDER_GAPI	1
    3.10 -#endif
    3.11 -#else
    3.12 +#ifndef _WIN32_WCE
    3.13  #ifndef SDL_VIDEO_RENDER_D3D
    3.14  #define SDL_VIDEO_RENDER_D3D	1
    3.15  #endif
     4.1 --- a/src/video/windows/SDL_ceddrawrender.c	Mon Jan 31 22:44:43 2011 -0800
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,818 +0,0 @@
     4.4 -/*
     4.5 -    SDL - Simple DirectMedia Layer
     4.6 -    Copyright (C) 1997-2010 Sam Lantinga
     4.7 -
     4.8 -    This library is free software; you can redistribute it and/or
     4.9 -    modify it under the terms of the GNU Lesser General Public
    4.10 -    License as published by the Free Software Foundation; either
    4.11 -    version 2.1 of the License, or (at your option) any later version.
    4.12 -
    4.13 -    This library is distributed in the hope that it will be useful,
    4.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 -    Lesser General Public License for more details.
    4.17 -
    4.18 -    You should have received a copy of the GNU Lesser General Public
    4.19 -    License along with this library; if not, write to the Free Software
    4.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    4.21 -
    4.22 -    Sam Lantinga
    4.23 -    slouken@libsdl.org
    4.24 -    
    4.25 -    Stefan Klug
    4.26 -    klug.stefan@gmx.de
    4.27 -*/
    4.28 -#include "SDL_config.h"
    4.29 -
    4.30 -#if SDL_VIDEO_RENDER_DDRAW
    4.31 -
    4.32 -#include "SDL_windowsvideo.h"
    4.33 -#include "../SDL_yuv_sw_c.h"
    4.34 -
    4.35 -#if 0
    4.36 -#define DDRAW_LOG(...) printf(__VA_ARGS__)
    4.37 -#else
    4.38 -#define DDRAW_LOG(...)
    4.39 -#endif
    4.40 -
    4.41 -
    4.42 -/* DirectDraw renderer implementation */
    4.43 -
    4.44 -static SDL_Renderer *DDRAW_CreateRenderer(SDL_Window * window, Uint32 flags);
    4.45 -static int DDRAW_DisplayModeChanged(SDL_Renderer * renderer);
    4.46 -static int DDRAW_CreateTexture(SDL_Renderer * renderer,
    4.47 -                               SDL_Texture * texture);
    4.48 -static int DDRAW_QueryTexturePixels(SDL_Renderer * renderer,
    4.49 -                                    SDL_Texture * texture, void **pixels,
    4.50 -                                    int *pitch);
    4.51 -static int DDRAW_SetTextureColorMod(SDL_Renderer * renderer,
    4.52 -                                    SDL_Texture * texture);
    4.53 -static int DDRAW_SetTextureAlphaMod(SDL_Renderer * renderer,
    4.54 -                                    SDL_Texture * texture);
    4.55 -static int DDRAW_SetTextureBlendMode(SDL_Renderer * renderer,
    4.56 -                                     SDL_Texture * texture);
    4.57 -static int DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.58 -                               const SDL_Rect * rect, const void *pixels,
    4.59 -                               int pitch);
    4.60 -static int DDRAW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.61 -                             const SDL_Rect * rect, int markDirty,
    4.62 -                             void **pixels, int *pitch);
    4.63 -static void DDRAW_UnlockTexture(SDL_Renderer * renderer,
    4.64 -                                SDL_Texture * texture);
    4.65 -static void DDRAW_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.66 -                               int numrects, const SDL_Rect * rects);
    4.67 -static int DDRAW_RenderPoint(SDL_Renderer * renderer, int x, int y);
    4.68 -static int DDRAW_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2,
    4.69 -                            int y2);
    4.70 -static int DDRAW_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect);
    4.71 -static int DDRAW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    4.72 -                            const SDL_Rect * srcrect,
    4.73 -                            const SDL_Rect * dstrect);
    4.74 -static void DDRAW_RenderPresent(SDL_Renderer * renderer);
    4.75 -static void DDRAW_DestroyTexture(SDL_Renderer * renderer,
    4.76 -                                 SDL_Texture * texture);
    4.77 -static void DDRAW_DestroyRenderer(SDL_Renderer * renderer);
    4.78 -
    4.79 -
    4.80 -SDL_RenderDriver DDRAW_RenderDriver = {
    4.81 -    DDRAW_CreateRenderer,
    4.82 -    {
    4.83 -     "ddraw",
    4.84 -     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
    4.85 -      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
    4.86 -      SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
    4.87 -     (SDL_TEXTUREMODULATE_NONE),
    4.88 -     (SDL_BLENDMODE_NONE),
    4.89 -     0,
    4.90 -     {0},
    4.91 -     0,
    4.92 -     0}
    4.93 -};
    4.94 -
    4.95 -typedef struct
    4.96 -{
    4.97 -    IDirectDraw *ddraw;
    4.98 -    IDirectDrawSurface *primary;
    4.99 -} DDRAW_RenderData;
   4.100 -
   4.101 -typedef struct
   4.102 -{
   4.103 -    RECT lock;
   4.104 -    IDirectDrawSurface *surface;
   4.105 -} DDRAW_TextureData;
   4.106 -
   4.107 -
   4.108 -static void
   4.109 -DDRAW_SetError(const char *prefix, HRESULT result)
   4.110 -{
   4.111 -    const char *error;
   4.112 -
   4.113 -    switch (result) {
   4.114 -    case DDERR_CANTCREATEDC:
   4.115 -        error = "CANTCREATEDC";
   4.116 -        break;
   4.117 -    case DDERR_CANTLOCKSURFACE:
   4.118 -        error = "CANTLOCKSURFACE";
   4.119 -        break;
   4.120 -    case DDERR_CLIPPERISUSINGHWND:
   4.121 -        error = "CLIPPERISUSINGHWND";
   4.122 -        break;
   4.123 -    case DDERR_COLORKEYNOTSET:
   4.124 -        error = "COLORKEYNOTSET";
   4.125 -        break;
   4.126 -    case DDERR_CURRENTLYNOTAVAIL:
   4.127 -        error = "CURRENTLYNOTAVAIL";
   4.128 -        break;
   4.129 -    case DDERR_DCALREADYCREATED:
   4.130 -        error = "DCALREADYCREATED";
   4.131 -        break;
   4.132 -    case DDERR_DEVICEDOESNTOWNSURFACE:
   4.133 -        error = "DEVICEDOESNTOWNSURFACE";
   4.134 -        break;
   4.135 -    case DDERR_DIRECTDRAWALREADYCREATED:
   4.136 -        error = "DIRECTDRAWALREADYCREATED";
   4.137 -        break;
   4.138 -    case DDERR_EXCLUSIVEMODEALREADYSET:
   4.139 -        error = "EXCLUSIVEMODEALREADYSET";
   4.140 -        break;
   4.141 -    case DDERR_GENERIC:
   4.142 -        error = "GENERIC";
   4.143 -        break;
   4.144 -    case DDERR_HEIGHTALIGN:
   4.145 -        error = "HEIGHTALIGN";
   4.146 -        break;
   4.147 -    case DDERR_IMPLICITLYCREATED:
   4.148 -        error = "IMPLICITLYCREATED";
   4.149 -        break;
   4.150 -    case DDERR_INCOMPATIBLEPRIMARY:
   4.151 -        error = "INCOMPATIBLEPRIMARY";
   4.152 -        break;
   4.153 -    case DDERR_INVALIDCAPS:
   4.154 -        error = "INVALIDCAPS";
   4.155 -        break;
   4.156 -    case DDERR_INVALIDCLIPLIST:
   4.157 -        error = "INVALIDCLIPLIST";
   4.158 -        break;
   4.159 -    case DDERR_INVALIDMODE:
   4.160 -        error = "INVALIDMODE";
   4.161 -        break;
   4.162 -    case DDERR_INVALIDOBJECT:
   4.163 -        error = "INVALIDOBJECT";
   4.164 -        break;
   4.165 -    case DDERR_INVALIDPARAMS:
   4.166 -        error = "INVALIDPARAMS";
   4.167 -        break;
   4.168 -    case DDERR_INVALIDPIXELFORMAT:
   4.169 -        error = "INVALIDPIXELFORMAT";
   4.170 -        break;
   4.171 -    case DDERR_INVALIDPOSITION:
   4.172 -        error = "INVALIDPOSITION";
   4.173 -        break;
   4.174 -    case DDERR_INVALIDRECT:
   4.175 -        error = "INVALIDRECT";
   4.176 -        break;
   4.177 -    case DDERR_LOCKEDSURFACES:
   4.178 -        error = "LOCKEDSURFACES";
   4.179 -        break;
   4.180 -    case DDERR_MOREDATA:
   4.181 -        error = "MOREDATA";
   4.182 -        break;
   4.183 -    case DDERR_NOALPHAHW:
   4.184 -        error = "NOALPHAHW";
   4.185 -        break;
   4.186 -    case DDERR_NOBLTHW:
   4.187 -        error = "NOBLTHW";
   4.188 -        break;
   4.189 -    case DDERR_NOCLIPLIST:
   4.190 -        error = "NOCLIPLIST";
   4.191 -        break;
   4.192 -    case DDERR_NOCLIPPERATTACHED:
   4.193 -        error = "NOCLIPPERATTACHED";
   4.194 -        break;
   4.195 -    case DDERR_NOCOLORCONVHW:
   4.196 -        error = "NOCOLORCONVHW";
   4.197 -        break;
   4.198 -    case DDERR_NOCOLORKEYHW:
   4.199 -        error = "NOCOLORKEYHW";
   4.200 -        break;
   4.201 -    case DDERR_NOCOOPERATIVELEVELSET:
   4.202 -        error = "NOCOOPERATIVELEVELSET";
   4.203 -        break;
   4.204 -    case DDERR_NODC:
   4.205 -        error = "NODC";
   4.206 -        break;
   4.207 -    case DDERR_NOFLIPHW:
   4.208 -        error = "NOFLIPHW";
   4.209 -        break;
   4.210 -    case DDERR_NOOVERLAYDEST:
   4.211 -        error = "NOOVERLAYDEST";
   4.212 -        break;
   4.213 -    case DDERR_NOOVERLAYHW:
   4.214 -        error = "NOOVERLAYHW";
   4.215 -        break;
   4.216 -    case DDERR_NOPALETTEATTACHED:
   4.217 -        error = "NOPALETTEATTACHED";
   4.218 -        break;
   4.219 -    case DDERR_NOPALETTEHW:
   4.220 -        error = "NOPALETTEHW";
   4.221 -        break;
   4.222 -    case DDERR_NORASTEROPHW:
   4.223 -        error = "NORASTEROPHW";
   4.224 -        break;
   4.225 -    case DDERR_NOSTRETCHHW:
   4.226 -        error = "NOSTRETCHHW";
   4.227 -        break;
   4.228 -    case DDERR_NOTAOVERLAYSURFACE:
   4.229 -        error = "NOTAOVERLAYSURFACE";
   4.230 -        break;
   4.231 -    case DDERR_NOTFLIPPABLE:
   4.232 -        error = "NOTFLIPPABLE";
   4.233 -        break;
   4.234 -    case DDERR_NOTFOUND:
   4.235 -        error = "NOTFOUND";
   4.236 -        break;
   4.237 -    case DDERR_NOTLOCKED:
   4.238 -        error = "NOTLOCKED";
   4.239 -        break;
   4.240 -    case DDERR_NOTPALETTIZED:
   4.241 -        error = "NOTPALETTIZED";
   4.242 -        break;
   4.243 -    case DDERR_NOVSYNCHW:
   4.244 -        error = "NOVSYNCHW";
   4.245 -        break;
   4.246 -    case DDERR_NOZOVERLAYHW:
   4.247 -        error = "NOZOVERLAYHW";
   4.248 -        break;
   4.249 -    case DDERR_OUTOFCAPS:
   4.250 -        error = "OUTOFCAPS";
   4.251 -        break;
   4.252 -    case DDERR_OUTOFMEMORY:
   4.253 -        error = "OUTOFMEMORY";
   4.254 -        break;
   4.255 -    case DDERR_OUTOFVIDEOMEMORY:
   4.256 -        error = "OUTOFVIDEOMEMORY";
   4.257 -        break;
   4.258 -    case DDERR_OVERLAPPINGRECTS:
   4.259 -        error = "OVERLAPPINGRECTS";
   4.260 -        break;
   4.261 -    case DDERR_OVERLAYNOTVISIBLE:
   4.262 -        error = "OVERLAYNOTVISIBLE";
   4.263 -        break;
   4.264 -    case DDERR_PALETTEBUSY:
   4.265 -        error = "PALETTEBUSY";
   4.266 -        break;
   4.267 -    case DDERR_PRIMARYSURFACEALREADYEXISTS:
   4.268 -        error = "PRIMARYSURFACEALREADYEXISTS";
   4.269 -        break;
   4.270 -    case DDERR_REGIONTOOSMALL:
   4.271 -        error = "REGIONTOOSMALL";
   4.272 -        break;
   4.273 -    case DDERR_SURFACEBUSY:
   4.274 -        error = "SURFACEBUSY";
   4.275 -        break;
   4.276 -    case DDERR_SURFACELOST:
   4.277 -        error = "SURFACELOST";
   4.278 -        break;
   4.279 -    case DDERR_TOOBIGHEIGHT:
   4.280 -        error = "TOOBIGHEIGHT";
   4.281 -        break;
   4.282 -    case DDERR_TOOBIGSIZE:
   4.283 -        error = "TOOBIGSIZE";
   4.284 -        break;
   4.285 -    case DDERR_TOOBIGWIDTH:
   4.286 -        error = "TOOBIGWIDTH";
   4.287 -        break;
   4.288 -    case DDERR_UNSUPPORTED:
   4.289 -        error = "UNSUPPORTED";
   4.290 -        break;
   4.291 -    case DDERR_UNSUPPORTEDFORMAT:
   4.292 -        error = "UNSUPPORTEDFORMAT";
   4.293 -        break;
   4.294 -    case DDERR_VERTICALBLANKINPROGRESS:
   4.295 -        error = "VERTICALBLANKINPROGRESS";
   4.296 -        break;
   4.297 -    case DDERR_VIDEONOTACTIVE:
   4.298 -        error = "VIDEONOTACTIVE";
   4.299 -        break;
   4.300 -    case DDERR_WASSTILLDRAWING:
   4.301 -        error = "WASSTILLDRAWING";
   4.302 -        break;
   4.303 -    case DDERR_WRONGMODE:
   4.304 -        error = "WRONGMODE";
   4.305 -        break;
   4.306 -    default:
   4.307 -        error = "UNKNOWN";
   4.308 -        break;
   4.309 -    }
   4.310 -    SDL_SetError("%s: %s", prefix, error);
   4.311 -}
   4.312 -
   4.313 -static SDL_bool
   4.314 -PixelFormatToDDPIXELFORMAT(Uint32 format, LPDDPIXELFORMAT dst)
   4.315 -{
   4.316 -    SDL_zerop(dst);
   4.317 -    dst->dwSize = sizeof(*dst);
   4.318 -
   4.319 -    if (SDL_ISPIXELFORMAT_FOURCC(format)) {
   4.320 -        dst->dwFlags = DDPF_FOURCC;
   4.321 -        dst->dwFourCC = format;
   4.322 -    } else if (SDL_ISPIXELFORMAT_INDEXED(format)) {
   4.323 -        SDL_SetError("Indexed pixelformats are not supported.");
   4.324 -        return SDL_FALSE;
   4.325 -    } else {
   4.326 -        int bpp;
   4.327 -        Uint32 Rmask, Gmask, Bmask, Amask;
   4.328 -        if (!SDL_PixelFormatEnumToMasks
   4.329 -            (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
   4.330 -            SDL_SetError("pixelformat not supported");
   4.331 -            return SDL_FALSE;
   4.332 -        }
   4.333 -
   4.334 -        if (!Rmask && !Gmask && !Bmask) {
   4.335 -            dst->dwFlags = DDPF_ALPHA;
   4.336 -            dst->dwAlphaBitDepth = bpp;
   4.337 -        } else {
   4.338 -            dst->dwFlags = DDPF_RGB;
   4.339 -            dst->dwRGBBitCount = bpp;
   4.340 -            dst->dwRBitMask = Rmask;
   4.341 -            dst->dwGBitMask = Gmask;
   4.342 -            dst->dwBBitMask = Bmask;
   4.343 -
   4.344 -            if (Amask) {
   4.345 -                dst->dwFlags |= DDPF_ALPHAPIXELS;
   4.346 -                dst->dwRGBAlphaBitMask = Amask;
   4.347 -            }
   4.348 -        }
   4.349 -    }
   4.350 -
   4.351 -    return SDL_TRUE;
   4.352 -}
   4.353 -
   4.354 -static SDL_bool
   4.355 -DDRAW_IsTextureFormatAvailable(IDirectDraw * ddraw, Uint32 display_format,
   4.356 -                               Uint32 texture_format)
   4.357 -{
   4.358 -    int bpp;
   4.359 -    Uint32 Rmask, Gmask, Bmask, Amask;
   4.360 -
   4.361 -    if (SDL_ISPIXELFORMAT_FOURCC(texture_format)) {
   4.362 -        //TODO I don't expect DDRAW to support all 4CC formats, but I don't know which ones
   4.363 -        return SDL_TRUE;
   4.364 -    }
   4.365 -    //These are only basic checks
   4.366 -    if (SDL_ISPIXELFORMAT_INDEXED(texture_format)) {
   4.367 -        return SDL_FALSE;
   4.368 -    }
   4.369 -
   4.370 -    if (!SDL_PixelFormatEnumToMasks
   4.371 -        (texture_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
   4.372 -        return SDL_FALSE;
   4.373 -    }
   4.374 -
   4.375 -    switch (bpp) {
   4.376 -    case 4:
   4.377 -    case 8:
   4.378 -    case 16:
   4.379 -    case 24:
   4.380 -    case 32:
   4.381 -        break;
   4.382 -    default:
   4.383 -        return SDL_FALSE;
   4.384 -    }
   4.385 -
   4.386 -    return SDL_TRUE;
   4.387 -}
   4.388 -
   4.389 -void
   4.390 -DDRAW_AddRenderDriver(_THIS)
   4.391 -{
   4.392 -    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
   4.393 -    SDL_RendererInfo *info = &DDRAW_RenderDriver.info;
   4.394 -    SDL_DisplayMode *mode = &SDL_CurrentDisplay->desktop_mode;
   4.395 -
   4.396 -    if (data->ddraw) {
   4.397 -        int i;
   4.398 -        int formats[] = {
   4.399 -            SDL_PIXELFORMAT_INDEX8,
   4.400 -            SDL_PIXELFORMAT_RGB332,
   4.401 -            SDL_PIXELFORMAT_RGB444,
   4.402 -            SDL_PIXELFORMAT_RGB555,
   4.403 -            SDL_PIXELFORMAT_ARGB4444,
   4.404 -            SDL_PIXELFORMAT_ARGB1555,
   4.405 -            SDL_PIXELFORMAT_RGB565,
   4.406 -            SDL_PIXELFORMAT_RGB888,
   4.407 -            SDL_PIXELFORMAT_ARGB8888,
   4.408 -            SDL_PIXELFORMAT_ARGB2101010,
   4.409 -        };
   4.410 -
   4.411 -        for (i = 0; i < SDL_arraysize(formats); ++i) {
   4.412 -            if (DDRAW_IsTextureFormatAvailable
   4.413 -                (data->ddraw, mode->format, formats[i])) {
   4.414 -                info->texture_formats[info->num_texture_formats++] =
   4.415 -                    formats[i];
   4.416 -            }
   4.417 -        }
   4.418 -
   4.419 -        //TODO the fourcc formats should get fetched from IDirectDraw::GetFourCCCodes
   4.420 -        info->texture_formats[info->num_texture_formats++] =
   4.421 -            SDL_PIXELFORMAT_YV12;
   4.422 -        info->texture_formats[info->num_texture_formats++] =
   4.423 -            SDL_PIXELFORMAT_IYUV;
   4.424 -        info->texture_formats[info->num_texture_formats++] =
   4.425 -            SDL_PIXELFORMAT_YUY2;
   4.426 -        info->texture_formats[info->num_texture_formats++] =
   4.427 -            SDL_PIXELFORMAT_UYVY;
   4.428 -        info->texture_formats[info->num_texture_formats++] =
   4.429 -            SDL_PIXELFORMAT_YVYU;
   4.430 -
   4.431 -        for (i = 0; i < _this->num_displays; ++i)
   4.432 -            SDL_AddRenderDriver(&_this->displays[i], &DDRAW_RenderDriver);
   4.433 -        }
   4.434 -    }
   4.435 -}
   4.436 -
   4.437 -SDL_Renderer *
   4.438 -DDRAW_CreateRenderer(SDL_Window * window, Uint32 flags)
   4.439 -{
   4.440 -    SDL_VideoDisplay *display = window->display;
   4.441 -    SDL_VideoData *videodata = (SDL_VideoData *) display->device->driverdata;
   4.442 -    SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata;
   4.443 -    SDL_Renderer *renderer;
   4.444 -    DDRAW_RenderData *data;
   4.445 -    HRESULT result;
   4.446 -    DDSURFACEDESC ddsd;
   4.447 -
   4.448 -    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
   4.449 -    if (!renderer) {
   4.450 -        SDL_OutOfMemory();
   4.451 -        return NULL;
   4.452 -    }
   4.453 -
   4.454 -    data = (DDRAW_RenderData *) SDL_calloc(1, sizeof(*data));
   4.455 -    if (!data) {
   4.456 -        DDRAW_DestroyRenderer(renderer);
   4.457 -        SDL_OutOfMemory();
   4.458 -        return NULL;
   4.459 -    }
   4.460 -    data->ddraw = videodata->ddraw;
   4.461 -
   4.462 -    videodata->render = RENDER_DDRAW;
   4.463 -
   4.464 -    renderer->DisplayModeChanged = DDRAW_DisplayModeChanged;
   4.465 -    renderer->CreateTexture = DDRAW_CreateTexture;
   4.466 -    renderer->QueryTexturePixels = DDRAW_QueryTexturePixels;
   4.467 -
   4.468 -    renderer->SetTextureColorMod = DDRAW_SetTextureColorMod;
   4.469 -    renderer->SetTextureAlphaMod = DDRAW_SetTextureAlphaMod;
   4.470 -    renderer->SetTextureBlendMode = DDRAW_SetTextureBlendMode;
   4.471 -    renderer->UpdateTexture = DDRAW_UpdateTexture;
   4.472 -    renderer->LockTexture = DDRAW_LockTexture;
   4.473 -    renderer->UnlockTexture = DDRAW_UnlockTexture;
   4.474 -    renderer->DirtyTexture = DDRAW_DirtyTexture;
   4.475 -    renderer->RenderPoint = DDRAW_RenderPoint;
   4.476 -    renderer->RenderLine = DDRAW_RenderLine;
   4.477 -    renderer->RenderFill = DDRAW_RenderFill;
   4.478 -    renderer->RenderCopy = DDRAW_RenderCopy;
   4.479 -    renderer->RenderPresent = DDRAW_RenderPresent;
   4.480 -    renderer->DestroyTexture = DDRAW_DestroyTexture;
   4.481 -    renderer->DestroyRenderer = DDRAW_DestroyRenderer;
   4.482 -    renderer->info = DDRAW_RenderDriver.info;
   4.483 -    renderer->window = window;
   4.484 -    renderer->driverdata = data;
   4.485 -
   4.486 -    renderer->info.flags = SDL_RENDERER_ACCELERATED;
   4.487 -
   4.488 -    SDL_zero(ddsd);
   4.489 -    ddsd.dwSize = sizeof(ddsd);
   4.490 -    ddsd.dwFlags = DDSD_CAPS;
   4.491 -
   4.492 -    if (window->flags & SDL_WINDOW_FULLSCREEN) {
   4.493 -        ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
   4.494 -    } else {
   4.495 -        //TODO handle non fullscreen
   4.496 -        SDL_SetError("DirectDraw renderer has only fullscreen implemented");
   4.497 -        DDRAW_DestroyRenderer(renderer);
   4.498 -        return NULL;
   4.499 -    }
   4.500 -
   4.501 -    if (flags & SDL_RENDERER_PRESENTFLIP2) {
   4.502 -        ddsd.dwFlags |= DDSD_BACKBUFFERCOUNT;
   4.503 -        ddsd.dwBackBufferCount = 2;
   4.504 -    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
   4.505 -        ddsd.dwFlags |= DDSD_BACKBUFFERCOUNT;
   4.506 -        ddsd.dwBackBufferCount = 3;
   4.507 -    } else if (flags & SDL_RENDERER_PRESENTCOPY) {
   4.508 -        //TODO what is the best approximation to this mode
   4.509 -    } else {
   4.510 -
   4.511 -    }
   4.512 -
   4.513 -    if (flags & SDL_RENDERER_PRESENTVSYNC) {
   4.514 -        SDL_SetError("DirectDraw renderer with v-sync is not implemented");
   4.515 -        DDRAW_DestroyRenderer(renderer);
   4.516 -        return NULL;
   4.517 -    }
   4.518 -
   4.519 -    result =
   4.520 -        data->ddraw->lpVtbl->SetCooperativeLevel(data->ddraw,
   4.521 -                                                 windowdata->hwnd,
   4.522 -                                                 DDSCL_NORMAL);
   4.523 -    if (result != DD_OK) {
   4.524 -        DDRAW_SetError("CreateDevice()", result);
   4.525 -        DDRAW_DestroyRenderer(renderer);
   4.526 -        return NULL;
   4.527 -    }
   4.528 -
   4.529 -    result =
   4.530 -        data->ddraw->lpVtbl->CreateSurface(data->ddraw, &ddsd, &data->primary,
   4.531 -                                           NULL);
   4.532 -    if (result != DD_OK) {
   4.533 -        DDRAW_SetError("CreateDevice()", result);
   4.534 -        DDRAW_DestroyRenderer(renderer);
   4.535 -        return NULL;
   4.536 -    }
   4.537 -
   4.538 -    return renderer;
   4.539 -}
   4.540 -
   4.541 -static int
   4.542 -DDRAW_Reset(SDL_Renderer * renderer)
   4.543 -{
   4.544 -    //TODO implement
   4.545 -    /*D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
   4.546 -       HRESULT result;
   4.547 -
   4.548 -       result = IDirect3DDevice9_Reset(data->device, &data->pparams);
   4.549 -       if (FAILED(result)) {
   4.550 -       if (result == D3DERR_DEVICELOST) {
   4.551 -       /* Don't worry about it, we'll reset later... *
   4.552 -       return 0;
   4.553 -       } else {
   4.554 -       D3D_SetError("Reset()", result);
   4.555 -       return -1;
   4.556 -       }
   4.557 -       }
   4.558 -       IDirect3DDevice9_SetVertexShader(data->device, NULL);
   4.559 -       IDirect3DDevice9_SetFVF(data->device,
   4.560 -       D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
   4.561 -       IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE,
   4.562 -       D3DCULL_NONE);
   4.563 -       IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE); */
   4.564 -    return 0;
   4.565 -}
   4.566 -
   4.567 -static int
   4.568 -DDRAW_DisplayModeChanged(SDL_Renderer * renderer)
   4.569 -{
   4.570 -    //TODO implement
   4.571 -    /*D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
   4.572 -       SDL_Window *window = renderer->window;
   4.573 -       SDL_VideoDisplay *display = window->display;
   4.574 -
   4.575 -       data->pparams.BackBufferWidth = window->w;
   4.576 -       data->pparams.BackBufferHeight = window->h;
   4.577 -       if (window->flags & SDL_WINDOW_FULLSCREEN) {
   4.578 -       data->pparams.BackBufferFormat =
   4.579 -       PixelFormatToD3DFMT(display->fullscreen_mode.format);
   4.580 -       } else {
   4.581 -       data->pparams.BackBufferFormat = D3DFMT_UNKNOWN;
   4.582 -       }
   4.583 -       return D3D_Reset(renderer); */
   4.584 -    return 0;
   4.585 -}
   4.586 -
   4.587 -static int
   4.588 -DDRAW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
   4.589 -{
   4.590 -    DDRAW_RenderData *renderdata = (DDRAW_RenderData *) renderer->driverdata;
   4.591 -    SDL_Window *window = renderer->window;
   4.592 -    SDL_VideoDisplay *display = window->display;
   4.593 -    Uint32 display_format = display->current_mode.format;
   4.594 -    DDRAW_TextureData *data;
   4.595 -    DDSURFACEDESC ddsd;
   4.596 -    HRESULT result;
   4.597 -
   4.598 -    data = (DDRAW_TextureData *) SDL_calloc(1, sizeof(*data));
   4.599 -    if (!data) {
   4.600 -        SDL_OutOfMemory();
   4.601 -        return -1;
   4.602 -    }
   4.603 -
   4.604 -    SDL_zero(ddsd);
   4.605 -    ddsd.dwSize = sizeof(ddsd);
   4.606 -    ddsd.dwFlags = DDSD_PIXELFORMAT | DDSD_HEIGHT | DDSD_WIDTH;
   4.607 -    ddsd.dwWidth = texture->w;
   4.608 -    ddsd.dwHeight = texture->h;
   4.609 -
   4.610 -
   4.611 -    if (!PixelFormatToDDPIXELFORMAT(texture->format, &ddsd.ddpfPixelFormat)) {
   4.612 -        SDL_free(data);
   4.613 -        return -1;
   4.614 -    }
   4.615 -
   4.616 -    texture->driverdata = data;
   4.617 -
   4.618 -    result =
   4.619 -        renderdata->ddraw->lpVtbl->CreateSurface(renderdata->ddraw, &ddsd,
   4.620 -                                                 &data->surface, NULL);
   4.621 -    if (result != DD_OK) {
   4.622 -        SDL_free(data);
   4.623 -        DDRAW_SetError("CreateTexture", result);
   4.624 -        return -1;
   4.625 -    }
   4.626 -
   4.627 -    return 0;
   4.628 -}
   4.629 -
   4.630 -static int
   4.631 -DDRAW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
   4.632 -                         void **pixels, int *pitch)
   4.633 -{
   4.634 -    //TODO implement
   4.635 -    SDL_SetError("QueryTexturePixels is not implemented");
   4.636 -    return -1;
   4.637 -}
   4.638 -
   4.639 -static int
   4.640 -DDRAW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
   4.641 -{
   4.642 -    return 0;
   4.643 -}
   4.644 -
   4.645 -static int
   4.646 -DDRAW_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
   4.647 -{
   4.648 -    return 0;
   4.649 -}
   4.650 -
   4.651 -static int
   4.652 -DDRAW_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
   4.653 -{
   4.654 -    switch (texture->blendMode) {
   4.655 -    case SDL_BLENDMODE_NONE:
   4.656 -        return 0;
   4.657 -    default:
   4.658 -        SDL_Unsupported();
   4.659 -        texture->blendMode = SDL_BLENDMODE_NONE;
   4.660 -        return -1;
   4.661 -    }
   4.662 -}
   4.663 -
   4.664 -static int
   4.665 -DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.666 -                    const SDL_Rect * rect, const void *pixels, int pitch)
   4.667 -{
   4.668 -    DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   4.669 -
   4.670 -    //TODO implement
   4.671 -    SDL_SetError("UpdateTexture is not implemented");
   4.672 -    return 0;
   4.673 -}
   4.674 -
   4.675 -static int
   4.676 -DDRAW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.677 -                  const SDL_Rect * rect, int markDirty, void **pixels,
   4.678 -                  int *pitch)
   4.679 -{
   4.680 -    DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   4.681 -    HRESULT result;
   4.682 -    DDSURFACEDESC ddsd;
   4.683 -
   4.684 -    SDL_zero(ddsd);
   4.685 -    ddsd.dwSize = sizeof(ddsd);
   4.686 -
   4.687 -    /**
   4.688 -     * On a Axim x51v locking a subrect returns the startaddress of the whole surface,
   4.689 -     * wheras on my ASUS MyPal 696 the startaddress of the locked area is returned,
   4.690 -     * thats why I always lock the whole surface and calculate the pixels pointer by hand.
   4.691 -     * This shouldn't be a speed problem, as multiple locks aren't available on DDraw Mobile
   4.692 -     * see http://msdn.microsoft.com/en-us/library/ms858221.aspx
   4.693 -     */
   4.694 -
   4.695 -    result = data->surface->lpVtbl->Lock(data->surface, NULL, &ddsd, 0, NULL);
   4.696 -    if (result != DD_OK) {
   4.697 -        DDRAW_SetError("LockRect()", result);
   4.698 -        return -1;
   4.699 -    }
   4.700 -
   4.701 -    *pixels = ddsd.lpSurface + rect->y * ddsd.lPitch + rect->x * ddsd.lXPitch;
   4.702 -    *pitch = ddsd.lPitch;
   4.703 -    return 0;
   4.704 -}
   4.705 -
   4.706 -static void
   4.707 -DDRAW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
   4.708 -{
   4.709 -    DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   4.710 -
   4.711 -    data->surface->lpVtbl->Unlock(data->surface, NULL);
   4.712 -}
   4.713 -
   4.714 -static void
   4.715 -DDRAW_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.716 -                   int numrects, const SDL_Rect * rects)
   4.717 -{
   4.718 -}
   4.719 -
   4.720 -static void
   4.721 -DDRAW_SetBlendMode(DDRAW_RenderData * data, int blendMode)
   4.722 -{
   4.723 -    switch (blendMode) {
   4.724 -
   4.725 -    }
   4.726 -}
   4.727 -
   4.728 -static int
   4.729 -DDRAW_RenderPoint(SDL_Renderer * renderer, int x, int y)
   4.730 -{
   4.731 -    return -1;
   4.732 -}
   4.733 -
   4.734 -static int
   4.735 -DDRAW_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
   4.736 -{
   4.737 -    return -1;
   4.738 -}
   4.739 -
   4.740 -static int
   4.741 -DDRAW_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect)
   4.742 -{
   4.743 -    return -1;
   4.744 -}
   4.745 -
   4.746 -static int
   4.747 -DDRAW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
   4.748 -                 const SDL_Rect * srcrect, const SDL_Rect * dstrect)
   4.749 -{
   4.750 -    DDRAW_RenderData *data = (DDRAW_RenderData *) renderer->driverdata;
   4.751 -    DDRAW_TextureData *texturedata =
   4.752 -        (DDRAW_TextureData *) texture->driverdata;
   4.753 -    HRESULT result;
   4.754 -    RECT srcr;
   4.755 -    RECT dstr;
   4.756 -    DDBLTFX bltfx;
   4.757 -
   4.758 -    srcr.left = srcrect->x;
   4.759 -    srcr.top = srcrect->y;
   4.760 -    srcr.right = srcrect->x + srcrect->w;
   4.761 -    srcr.bottom = srcrect->y + srcrect->h;
   4.762 -
   4.763 -    dstr.left = dstrect->x;
   4.764 -    dstr.top = dstrect->y;
   4.765 -    dstr.right = dstrect->x + dstrect->w;
   4.766 -    dstr.bottom = dstrect->y + dstrect->h;
   4.767 -
   4.768 -    SDL_zero(bltfx);
   4.769 -    bltfx.dwSize = sizeof(bltfx);
   4.770 -    bltfx.dwROP = SRCCOPY;
   4.771 -
   4.772 -    data->primary->lpVtbl->Blt(data->primary, &dstr, texturedata->surface,
   4.773 -                               &srcr, DDBLT_ROP, &bltfx);
   4.774 -
   4.775 -    return 0;
   4.776 -}
   4.777 -
   4.778 -static void
   4.779 -DDRAW_RenderPresent(SDL_Renderer * renderer)
   4.780 -{
   4.781 -    DDRAW_RenderData *data = (DDRAW_RenderData *) renderer->driverdata;
   4.782 -    HRESULT result;
   4.783 -
   4.784 -    return;
   4.785 -
   4.786 -    result =
   4.787 -        data->primary->lpVtbl->Flip(data->primary, NULL, DDFLIP_INTERVAL1);
   4.788 -    if (result != DD_OK) {
   4.789 -        DDRAW_SetError("Present()", result);
   4.790 -    }
   4.791 -}
   4.792 -
   4.793 -static void
   4.794 -DDRAW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
   4.795 -{
   4.796 -    DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   4.797 -
   4.798 -    if (!data) {
   4.799 -        return;
   4.800 -    }
   4.801 -
   4.802 -    data->surface->lpVtbl->Release(data->surface);
   4.803 -    SDL_free(data);
   4.804 -    texture->driverdata = NULL;
   4.805 -}
   4.806 -
   4.807 -static void
   4.808 -DDRAW_DestroyRenderer(SDL_Renderer * renderer)
   4.809 -{
   4.810 -    DDRAW_RenderData *data = (DDRAW_RenderData *) renderer->driverdata;
   4.811 -
   4.812 -    if (data) {
   4.813 -        data->primary->lpVtbl->Release(data->primary);
   4.814 -        SDL_free(data);
   4.815 -    }
   4.816 -    SDL_free(renderer);
   4.817 -}
   4.818 -
   4.819 -#endif /* SDL_VIDEO_RENDER_DDRAW */
   4.820 -
   4.821 -/* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/video/windows/SDL_ceddrawrender.h	Mon Jan 31 22:44:43 2011 -0800
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,31 +0,0 @@
     5.4 -/*
     5.5 -    SDL - Simple DirectMedia Layer
     5.6 -    Copyright (C) 1997-2010 Sam Lantinga
     5.7 -
     5.8 -    This library is free software; you can redistribute it and/or
     5.9 -    modify it under the terms of the GNU Lesser General Public
    5.10 -    License as published by the Free Software Foundation; either
    5.11 -    version 2.1 of the License, or (at your option) any later version.
    5.12 -
    5.13 -    This library is distributed in the hope that it will be useful,
    5.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 -    Lesser General Public License for more details.
    5.17 -
    5.18 -    You should have received a copy of the GNU Lesser General Public
    5.19 -    License along with this library; if not, write to the Free Software
    5.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.21 -
    5.22 -    Sam Lantinga
    5.23 -    slouken@libsdl.org
    5.24 -    
    5.25 -    Stefan Klug
    5.26 -    klug.stefan@gmx.de
    5.27 -*/
    5.28 -#include "SDL_config.h"
    5.29 -
    5.30 -#if SDL_VIDEO_RENDER_DDRAW
    5.31 -extern void DDRAW_AddRenderDriver(_THIS);
    5.32 -#endif
    5.33 -
    5.34 -/* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/video/windows/SDL_gapirender.c	Mon Jan 31 22:44:43 2011 -0800
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,1293 +0,0 @@
     6.4 -/***************************************************************************
     6.5 - *   Copyright (C) 2010 by Andrey Afletdinov <afletdinov@gmail.com>        *
     6.6 - *                                                                         *
     6.7 - *   WinCE RAW/GAPI video driver                                           *
     6.8 - *                                                                         *
     6.9 - *   Part of the SDL - (Simple DirectMedia Layer)                          *
    6.10 - *   http://www.libsdl.org                                                 *
    6.11 - *                                                                         *
    6.12 - *   This program is free software; you can redistribute it and/or modify  *
    6.13 - *   it under the terms of the GNU General Public License as published by  *
    6.14 - *   the Free Software Foundation; either version 2 of the License, or     *
    6.15 - *   (at your option) any later version.                                   *
    6.16 - *                                                                         *
    6.17 - *   This program is distributed in the hope that it will be useful,       *
    6.18 - *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    6.19 - *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
    6.20 - *   GNU General Public License for more details.                          *
    6.21 - *                                                                         *
    6.22 - *   You should have received a copy of the GNU General Public License     *
    6.23 - *   along with this program; if not, write to the                         *
    6.24 - *   Free Software Foundation, Inc.,                                       *
    6.25 - *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
    6.26 - ***************************************************************************/
    6.27 -
    6.28 -#include "SDL_config.h"
    6.29 -
    6.30 -#if SDL_VIDEO_RENDER_GAPI
    6.31 -
    6.32 -#include "SDL_windowsvideo.h"
    6.33 -#include "SDL_windowswindow.h"
    6.34 -#include "../SDL_yuv_sw_c.h"
    6.35 -
    6.36 -// RawFrameBufferInfo
    6.37 -typedef struct
    6.38 -{
    6.39 -   WORD wFormat;
    6.40 -   WORD wBPP;
    6.41 -   VOID *pFramePointer;
    6.42 -   int  cxStride;
    6.43 -   int  cyStride;
    6.44 -   int  cxPixels;
    6.45 -   int  cyPixels;
    6.46 -} RawFrameBufferInfo;
    6.47 -
    6.48 -// GXDeviceInfo
    6.49 -typedef struct
    6.50 -{
    6.51 -    long Version;
    6.52 -    void* pvFrameBuffer;
    6.53 -    unsigned long cbStride;
    6.54 -    unsigned long cxWidth;
    6.55 -    unsigned long cyHeight;
    6.56 -    unsigned long cBPP;
    6.57 -    unsigned long ffFormat;
    6.58 -    char unknown[0x84 - 7 * 4];
    6.59 -} GXDeviceInfo;
    6.60 -
    6.61 -// wince: GXDisplayProperties
    6.62 -struct GXDisplayProperties
    6.63 -{
    6.64 -    DWORD cxWidth;
    6.65 -    DWORD cyHeight;
    6.66 -    long cbxPitch;
    6.67 -    long cbyPitch;
    6.68 -    long cBPP;
    6.69 -    DWORD ffFormat;
    6.70 -};
    6.71 -
    6.72 -// gx.dll
    6.73 -typedef int   (*PFNGXOpenDisplay)(HWND hWnd, DWORD dwFlags);
    6.74 -typedef int   (*PFNGXCloseDisplay)();
    6.75 -typedef void* (*PFNGXBeginDraw)();
    6.76 -typedef int   (*PFNGXEndDraw)();
    6.77 -typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties)();
    6.78 -typedef int   (*PFNGXSuspend)();
    6.79 -typedef int   (*PFNGXResume)();
    6.80 -
    6.81 -typedef struct
    6.82 -{
    6.83 -    // gx.dll
    6.84 -    void*                     hGapiLib;
    6.85 -    PFNGXOpenDisplay          GXOpenDisplay;
    6.86 -    PFNGXCloseDisplay         GXCloseDisplay;
    6.87 -    PFNGXBeginDraw            GXBeginDraw;
    6.88 -    PFNGXEndDraw              GXEndDraw;
    6.89 -    PFNGXGetDisplayProperties GXGetDisplayProperties;
    6.90 -    PFNGXSuspend              GXSuspend;
    6.91 -    PFNGXResume               GXResume;
    6.92 -} GapiInfo;
    6.93 -
    6.94 -//#ifndef DM_DISPLAYORIENTATION
    6.95 -//#define DM_DISPLAYORIENTATION 0x00800000L
    6.96 -//#endif
    6.97 -
    6.98 -#define FORMAT_565                1
    6.99 -#define FORMAT_555                2
   6.100 -#define FORMAT_OTHER                3
   6.101 -
   6.102 -#define GETRAWFRAMEBUFFER        0x00020001
   6.103 -#define GETGXINFO                0x00020000
   6.104 -
   6.105 -#define kfPalette                0x10
   6.106 -#define kfDirect                0x20
   6.107 -#define kfDirect555                0x40
   6.108 -#define kfDirect565                0x80
   6.109 -
   6.110 -#define GX_FULLSCREEN                0x01
   6.111 -
   6.112 -enum ScreenOrientation { ORIENTATION_UNKNOWN = -1, ORIENTATION_UP = DMDO_0, ORIENTATION_DOWN = DMDO_180, ORIENTATION_LEFT = DMDO_270, ORIENTATION_RIGHT = DMDO_90 };
   6.113 -enum ScreenGeometry { GEOMETRY_UNKNOWN, GEOMETRY_PORTRAIT, GEOMETRY_LANDSCAPE, GEOMETRY_SQUARE };
   6.114 -enum FrameBufferFlags { FB_SKIP_OFFSET = 0x0001, FB_RAW_MODE = 0x0002, FB_SUSPENDED = 0x0004 };
   6.115 -
   6.116 -// private framebuffer info
   6.117 -typedef struct
   6.118 -{
   6.119 -    int width;
   6.120 -    int height;
   6.121 -    int xpitch;
   6.122 -    int ypitch;
   6.123 -    int offset;
   6.124 -} FrameBufferInfo;
   6.125 -
   6.126 -// private display data
   6.127 -typedef struct
   6.128 -{
   6.129 -    unsigned char* pixels;        // video memory
   6.130 -    int format;                        // video format
   6.131 -    FrameBufferInfo fb;                // framebuffer geometry
   6.132 -    GapiInfo* gapi;                // GAPI module
   6.133 -    int userOrientation;
   6.134 -    int systemOrientation;
   6.135 -    int hardwareGeometry;
   6.136 -    int flags;                        // fb flags
   6.137 -    float scale;                // scale pointer position
   6.138 -    int debug;
   6.139 -
   6.140 -} WINCE_RenderData;
   6.141 -
   6.142 -typedef struct
   6.143 -{
   6.144 -    SDL_SW_YUVTexture *yuv;
   6.145 -    Uint32 format;
   6.146 -    void *pixels;
   6.147 -    int pitch;
   6.148 -
   6.149 -} WINCE_TextureData;
   6.150 -
   6.151 -
   6.152 -// system func
   6.153 -SDL_Renderer*        WINCE_CreateRenderer(SDL_Window* window, Uint32 flags);
   6.154 -void                WINCE_DestroyRenderer(SDL_Renderer* renderer);
   6.155 -
   6.156 -int                WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture);
   6.157 -void                WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture);
   6.158 -int                WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch);
   6.159 -int                WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch);
   6.160 -int                WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch);
   6.161 -void                WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture);
   6.162 -
   6.163 -int                WINCE_Available(void);
   6.164 -void                WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height);
   6.165 -
   6.166 -int                WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect);
   6.167 -void                WINCE_ShowWindow(_THIS, SDL_Window* window, int visible);
   6.168 -
   6.169 -void                WINCE_RenderPresent(SDL_Renderer* renderer);
   6.170 -int                WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count);
   6.171 -int                WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count);
   6.172 -int                WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count);
   6.173 -int                WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count);
   6.174 -
   6.175 -void                WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt);
   6.176 -void                WINCE_DumpVideoInfo(WINCE_RenderData* data);
   6.177 -void                WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height);
   6.178 -void                WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height);
   6.179 -void                WINCE_SquareTransform(WINCE_RenderData* data, int width, int height);
   6.180 -int                WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug);
   6.181 -int                WINCE_GetDMOrientation(void);
   6.182 -int                WINCE_SetDMOrientation(int orientation);
   6.183 -void                WINCE_UpdateYUVTextureData(SDL_Texture* texture);
   6.184 -
   6.185 -// gapi engine specific
   6.186 -int                GAPI_Init(WINCE_RenderData* data, HWND hwnd);
   6.187 -void                GAPI_Quit(WINCE_RenderData* data);
   6.188 -
   6.189 -// raw engine specific
   6.190 -int                RAW_Init(WINCE_RenderData* data);
   6.191 -void                RAW_Quit(WINCE_RenderData* data);
   6.192 -
   6.193 -// tools
   6.194 -void                FrameBufferRotate(FrameBufferInfo* src, int orientation);
   6.195 -int                GetFrameBufferOrientation(const FrameBufferInfo* src);
   6.196 -void                PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation);
   6.197 -void                FrameBufferInitialize(FrameBufferInfo* fb);
   6.198 -void                FrameBufferDumpInfo(const FrameBufferInfo* fb, const char*);
   6.199 -const                char* GetOrientationName(int orientation);
   6.200 -void                UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width);
   6.201 -
   6.202 -// stdlib
   6.203 -static __inline__ int        __abs(int x){ return x < 0 ? -x : x; };
   6.204 -static __inline__ void        __swap(int* a, int* b){ int t = *a; *a = *b; *b = t; };
   6.205 -
   6.206 -#define GAPI_RENDER_NAME        "gapi"
   6.207 -#define RAW_RENDER_NAME                "raw"
   6.208 -//
   6.209 -SDL_RenderDriver GAPI_RenderDriver = {
   6.210 -    WINCE_CreateRenderer,
   6.211 -    {
   6.212 -        GAPI_RENDER_NAME,
   6.213 -        (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
   6.214 -        (SDL_TEXTUREMODULATE_NONE),
   6.215 -        (SDL_BLENDMODE_NONE),
   6.216 -        7,
   6.217 -        {
   6.218 -            SDL_PIXELFORMAT_RGB555,
   6.219 -            SDL_PIXELFORMAT_RGB565,
   6.220 -            SDL_PIXELFORMAT_YV12,
   6.221 -            SDL_PIXELFORMAT_IYUV,
   6.222 -            SDL_PIXELFORMAT_YUY2,
   6.223 -            SDL_PIXELFORMAT_UYVY,
   6.224 -            SDL_PIXELFORMAT_YVYU
   6.225 -        },
   6.226 -        0,
   6.227 -        0
   6.228 -    }
   6.229 -};
   6.230 -
   6.231 -SDL_RenderDriver RAW_RenderDriver = {
   6.232 -    WINCE_CreateRenderer,
   6.233 -    {
   6.234 -        RAW_RENDER_NAME,
   6.235 -        (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
   6.236 -        (SDL_TEXTUREMODULATE_NONE),
   6.237 -        (SDL_BLENDMODE_NONE),
   6.238 -        7,
   6.239 -        {
   6.240 -            SDL_PIXELFORMAT_RGB555,
   6.241 -            SDL_PIXELFORMAT_RGB565,
   6.242 -            SDL_PIXELFORMAT_YV12,
   6.243 -            SDL_PIXELFORMAT_IYUV,
   6.244 -            SDL_PIXELFORMAT_YUY2,
   6.245 -            SDL_PIXELFORMAT_UYVY,
   6.246 -            SDL_PIXELFORMAT_YVYU
   6.247 -        },
   6.248 -        0,
   6.249 -        0
   6.250 -    }
   6.251 -};
   6.252 -
   6.253 -int WINCE_Available(void)
   6.254 -{
   6.255 -    void* render_gapi;
   6.256 -    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
   6.257 -
   6.258 -    // raw check
   6.259 -    RawFrameBufferInfo rfbi = { 0 };
   6.260 -    HDC hdc = GetDC(NULL);
   6.261 -    int render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
   6.262 -    ReleaseDC(NULL, hdc);
   6.263 -
   6.264 -    if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 &&
   6.265 -       rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0)
   6.266 -        render_raw = 1;
   6.267 -
   6.268 -    if(preferably && 0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0 != render_raw;
   6.269 -
   6.270 -    // gapi check
   6.271 -    render_gapi = SDL_LoadObject("\\Windows\\gx.dll");
   6.272 -    if(0 == render_gapi)
   6.273 -        render_gapi = SDL_LoadObject("gx.dll");
   6.274 -    SDL_UnloadObject(render_gapi);
   6.275 -
   6.276 -    if(preferably && 0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0 != render_gapi;
   6.277 -
   6.278 -    return 0 != render_raw || 0 != render_gapi;
   6.279 -}
   6.280 -
   6.281 -void WINCE_AddRenderDriver(_THIS)
   6.282 -{
   6.283 -    HDC hdc;
   6.284 -    void* render_gapi;
   6.285 -    int render_raw, ii;
   6.286 -    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
   6.287 -
   6.288 -   // raw check
   6.289 -    RawFrameBufferInfo rfbi = { 0 };
   6.290 -    hdc = GetDC(NULL);
   6.291 -    render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
   6.292 -    ReleaseDC(NULL, hdc);
   6.293 -
   6.294 -    if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 &&
   6.295 -            rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0)
   6.296 -            render_raw = 1;
   6.297 -
   6.298 -    // gapi check
   6.299 -    render_gapi = SDL_LoadObject("\\Windows\\gx.dll");
   6.300 -    if(0 == render_gapi)
   6.301 -        render_gapi = SDL_LoadObject("gx.dll");
   6.302 -
   6.303 -    if(render_gapi)
   6.304 -        SDL_UnloadObject(render_gapi);
   6.305 -
   6.306 -    for(ii = 0; ii < _this->num_displays; ++ii)
   6.307 -    {
   6.308 -        if(preferably)
   6.309 -        {
   6.310 -            if(0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME) && render_raw)
   6.311 -                SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver);
   6.312 -            else
   6.313 -            if(0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME) && render_gapi)
   6.314 -                SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver);
   6.315 -        }
   6.316 -        else
   6.317 -        {
   6.318 -            if(render_raw)
   6.319 -                SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver);
   6.320 -            if(render_gapi)
   6.321 -                SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver);
   6.322 -        }
   6.323 -    }
   6.324 -}
   6.325 -
   6.326 -SDL_Renderer* WINCE_CreateRenderer(SDL_Window* window, Uint32 flags)
   6.327 -{
   6.328 -    SDL_VideoDisplay* display = window->display;
   6.329 -    SDL_DisplayMode* displayMode = &display->current_mode;
   6.330 -    SDL_WindowData* windowdata = (SDL_WindowData *) window->driverdata;
   6.331 -    SDL_Renderer* renderer;
   6.332 -    WINCE_RenderData* data;
   6.333 -    int bpp;
   6.334 -    Uint32 Rmask, Gmask, Bmask, Amask;
   6.335 -
   6.336 -    if(!(window->flags & SDL_WINDOW_FULLSCREEN))
   6.337 -        window->flags |= SDL_WINDOW_FULLSCREEN;
   6.338 -
   6.339 -    if(!SDL_PixelFormatEnumToMasks(displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask))
   6.340 -    {
   6.341 -        SDL_SetError("Unknown display format");
   6.342 -        return NULL;
   6.343 -    }
   6.344 -
   6.345 -    switch(window->fullscreen_mode.format)
   6.346 -    {
   6.347 -        case SDL_PIXELFORMAT_RGB555:
   6.348 -        case SDL_PIXELFORMAT_RGB565:
   6.349 -            break;
   6.350 -
   6.351 -        default:
   6.352 -            SDL_SetError("Support only 16 or 15 bpp");
   6.353 -            return NULL;
   6.354 -    }
   6.355 -
   6.356 -    renderer = (SDL_Renderer*) SDL_calloc(1, sizeof(SDL_Renderer));
   6.357 -    if(!renderer)
   6.358 -    {
   6.359 -        SDL_OutOfMemory();
   6.360 -        return NULL;
   6.361 -    }
   6.362 -
   6.363 -    data = (WINCE_RenderData*) SDL_calloc(1, sizeof(WINCE_RenderData));
   6.364 -    if(!data)
   6.365 -    {
   6.366 -        WINCE_DestroyRenderer(renderer);
   6.367 -        SDL_OutOfMemory();
   6.368 -        return NULL;
   6.369 -    }
   6.370 -
   6.371 -    // initialize internal engine
   6.372 -    if(!RAW_Init(data) && !GAPI_Init(data, windowdata->hwnd))
   6.373 -    {
   6.374 -        WINCE_DestroyRenderer(renderer);
   6.375 -        return NULL;
   6.376 -    }
   6.377 -
   6.378 -
   6.379 -    // set debug
   6.380 -    data->debug        = SDL_getenv("DEBUG_VIDEO_GAPI") || SDL_getenv("GAPI_RENDERER_DEBUG") ? 1 : 0;
   6.381 -#if defined(DEBUG_VIDEO_GAPI) || defined(GAPI_RENDERER_DEBUG)
   6.382 -    data->debug        = 1;
   6.383 -#endif
   6.384 -
   6.385 -    windowdata->videodata->render = data->gapi ? RENDER_GAPI : RENDER_RAW;
   6.386 -    windowdata->videodata->CoordTransform = WINCE_PointerCoordinateTransform;
   6.387 -
   6.388 -    window->display->device->MaximizeWindow = NULL;
   6.389 -    window->display->device->MinimizeWindow = NULL;
   6.390 -
   6.391 -    WINCE_SetupOrientation(data, window->w, window->h);
   6.392 -
   6.393 -    renderer->CreateTexture = WINCE_CreateTexture;
   6.394 -    renderer->DestroyTexture = WINCE_DestroyTexture;
   6.395 -    renderer->QueryTexturePixels = WINCE_QueryTexturePixels;
   6.396 -    renderer->UpdateTexture = WINCE_UpdateTexture;
   6.397 -    renderer->LockTexture = WINCE_LockTexture;
   6.398 -    renderer->UnlockTexture = WINCE_UnlockTexture;
   6.399 -
   6.400 -    renderer->RenderCopy = WINCE_RenderCopy;
   6.401 -    renderer->DestroyRenderer = WINCE_DestroyRenderer;
   6.402 -
   6.403 -    renderer->RenderPresent = WINCE_RenderPresent;
   6.404 -    renderer->RenderDrawPoints = WINCE_RenderDrawPoints;
   6.405 -    renderer->RenderDrawLines = WINCE_RenderDrawLines;
   6.406 -    renderer->RenderDrawRects = WINCE_RenderDrawRects;
   6.407 -    renderer->RenderFillRects = WINCE_RenderFillRects;
   6.408 -
   6.409 -    renderer->info = data->gapi ? GAPI_RenderDriver.info : RAW_RenderDriver.info;
   6.410 -
   6.411 -    renderer->window = window;
   6.412 -    renderer->driverdata = data;
   6.413 -
   6.414 -    return renderer;
   6.415 -}
   6.416 -
   6.417 -void WINCE_DestroyRenderer(SDL_Renderer* renderer)
   6.418 -{
   6.419 -    WINCE_RenderData *renderdata = (WINCE_RenderData*) renderer->driverdata;
   6.420 -
   6.421 -    if(renderdata)
   6.422 -    {
   6.423 -        if(renderdata->gapi)
   6.424 -            GAPI_Quit(renderdata);
   6.425 -        else
   6.426 -            RAW_Quit(renderdata);
   6.427 -
   6.428 -        SDL_free(renderdata);
   6.429 -    }
   6.430 -
   6.431 -    SDL_free(renderer);
   6.432 -}
   6.433 -
   6.434 -int WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture)
   6.435 -{
   6.436 -    WINCE_TextureData* texturedata = (WINCE_TextureData*) SDL_calloc(1, sizeof(WINCE_TextureData));
   6.437 -    if(NULL == texturedata)
   6.438 -    {
   6.439 -        SDL_OutOfMemory();
   6.440 -        return -1;
   6.441 -    }
   6.442 -
   6.443 -    texturedata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
   6.444 -    texturedata->pixels = SDL_malloc(texture->h * texturedata->pitch);
   6.445 -    if(NULL == texturedata->pixels)
   6.446 -    {
   6.447 -        SDL_OutOfMemory();
   6.448 -        return -1;
   6.449 -    }
   6.450 -
   6.451 -    if(SDL_ISPIXELFORMAT_FOURCC(texture->format))
   6.452 -    {
   6.453 -        SDL_Window* window = renderer->window;
   6.454 -        SDL_VideoDisplay* display = window->display;
   6.455 -
   6.456 -        texturedata->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
   6.457 -        if(NULL == texturedata->yuv)
   6.458 -        {
   6.459 -            SDL_OutOfMemory();
   6.460 -            return -1;
   6.461 -        }
   6.462 -        texturedata->format = display->current_mode.format;
   6.463 -    }
   6.464 -    else
   6.465 -    {
   6.466 -        texturedata->yuv = NULL;
   6.467 -        texturedata->format = texture->format;
   6.468 -    }
   6.469 -
   6.470 -    texture->driverdata = texturedata;
   6.471 -
   6.472 -    return 0;
   6.473 -}
   6.474 -
   6.475 -void WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture)
   6.476 -{
   6.477 -    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
   6.478 -
   6.479 -    if(texturedata)
   6.480 -    {
   6.481 -        if(texturedata->yuv) SDL_SW_DestroyYUVTexture(texturedata->yuv);
   6.482 -        if(texturedata->pixels) SDL_free(texturedata->pixels);
   6.483 -        SDL_free(texturedata);
   6.484 -        texture->driverdata = NULL;
   6.485 -    }
   6.486 -}
   6.487 -
   6.488 -int WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch)
   6.489 -{
   6.490 -    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
   6.491 -
   6.492 -    if(texturedata->yuv)
   6.493 -        return SDL_SW_QueryYUVTexturePixels(texturedata->yuv, pixels, pitch);
   6.494 -
   6.495 -    *pixels = texturedata->pixels;
   6.496 -    *pitch = texturedata->pitch;
   6.497 -
   6.498 -    return 0;
   6.499 -}
   6.500 -
   6.501 -int WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch)
   6.502 -{
   6.503 -    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
   6.504 -
   6.505 -    if(texturedata->yuv)
   6.506 -    {
   6.507 -        if(SDL_SW_UpdateYUVTexture(texturedata->yuv, rect, pixels, pitch) < 0)
   6.508 -            return -1;
   6.509 -        WINCE_UpdateYUVTextureData(texture);
   6.510 -        return 0;
   6.511 -    }
   6.512 -
   6.513 -    if(0 < rect->w && 0 < rect->h)
   6.514 -    {
   6.515 -        const unsigned char *src = ((const unsigned char*) pixels);
   6.516 -        unsigned char *dst = ((unsigned char*) texturedata->pixels) +
   6.517 -                                rect->y * texturedata->pitch +
   6.518 -                                rect->x * SDL_BYTESPERPIXEL(texture->format);
   6.519 -        int length = rect->w * SDL_BYTESPERPIXEL(texture->format);
   6.520 -        int height = rect->h;
   6.521 -
   6.522 -        while(height--)
   6.523 -        {
   6.524 -            SDL_memcpy(dst, src, length);
   6.525 -            dst += texturedata->pitch;
   6.526 -            src += pitch;
   6.527 -        }
   6.528 -    }
   6.529 -
   6.530 -    return 0;
   6.531 -}
   6.532 -
   6.533 -int WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch)
   6.534 -{
   6.535 -    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
   6.536 -
   6.537 -    if(texturedata->yuv)
   6.538 -        return SDL_SW_LockYUVTexture(texturedata->yuv, rect, dirty, pixels, pitch);
   6.539 -
   6.540 -    *pixels = (void *) ((unsigned char*) texturedata->pixels +
   6.541 -                    rect->y * texturedata->pitch +
   6.542 -                    rect->x * SDL_BYTESPERPIXEL(texture->format));
   6.543 -    *pitch = texturedata->pitch;
   6.544 -    return 0;
   6.545 -}
   6.546 -
   6.547 -void WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture)
   6.548 -{
   6.549 -    WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata;
   6.550 -
   6.551 -    if(texturedata->yuv)
   6.552 -    {
   6.553 -        SDL_SW_UnlockYUVTexture(texturedata->yuv);
   6.554 -        WINCE_UpdateYUVTextureData(texture);
   6.555 -    }
   6.556 -}
   6.557 -
   6.558 -int WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect)
   6.559 -{
   6.560 -    WINCE_RenderData* dstdata = (WINCE_RenderData*) renderer->driverdata;
   6.561 -    WINCE_TextureData* srcdata = (WINCE_TextureData*) texture->driverdata;
   6.562 -    const unsigned char *src;
   6.563 -    unsigned char *dst;
   6.564 -
   6.565 -    if((dstdata->flags & FB_SUSPENDED) ||
   6.566 -       0 >= srect->w || 0 >= srect->h) return 0;
   6.567 -
   6.568 -    // lock gapi
   6.569 -    if(dstdata->gapi) dstdata->gapi->GXBeginDraw();
   6.570 -
   6.571 -    src = ((const unsigned char*) srcdata->pixels);
   6.572 -    dst = dstdata->pixels + (dstdata->flags & FB_SKIP_OFFSET ? 0 : dstdata->fb.offset) +
   6.573 -                                drect->y * dstdata->fb.ypitch +
   6.574 -                                drect->x * dstdata->fb.xpitch;
   6.575 -    if(srcdata->yuv)
   6.576 -    {
   6.577 -        return SDL_SW_CopyYUVToRGB(srcdata->yuv,
   6.578 -                                   srect, srcdata->format,
   6.579 -                                   drect->w, drect->h, dst,
   6.580 -                                   dstdata->fb.ypitch);
   6.581 -    }
   6.582 -    else
   6.583 -    {
   6.584 -        int height = drect->h;
   6.585 -        int length = drect->w * SDL_BYTESPERPIXEL(texture->format); // in bytes
   6.586 -
   6.587 -        while(height--)
   6.588 -        {
   6.589 -            switch(SDL_BYTESPERPIXEL(texture->format))
   6.590 -            {
   6.591 -                case 2: UpdateLine16to16(&dstdata->fb, (Uint16*) src, (Uint16*) dst, length >> 1); break;
   6.592 -
   6.593 -                default: break;
   6.594 -            }
   6.595 -
   6.596 -            dst += dstdata->fb.ypitch;
   6.597 -            src += srcdata->pitch;
   6.598 -        }
   6.599 -    }
   6.600 -
   6.601 -    // unlock gapi
   6.602 -    if(dstdata->gapi) dstdata->gapi->GXEndDraw();
   6.603 -
   6.604 -    return 0;
   6.605 -}
   6.606 -
   6.607 -void WINCE_RenderPresent(SDL_Renderer* renderer)
   6.608 -{
   6.609 -}
   6.610 -
   6.611 -int WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count)
   6.612 -{
   6.613 -    SDL_Unsupported();
   6.614 -    return -1;
   6.615 -}
   6.616 -
   6.617 -int WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count)
   6.618 -{
   6.619 -    SDL_Unsupported();
   6.620 -    return -1;
   6.621 -}
   6.622 -
   6.623 -int WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count)
   6.624 -{
   6.625 -    SDL_Unsupported();
   6.626 -    return -1;
   6.627 -}
   6.628 -
   6.629 -int WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count)
   6.630 -{
   6.631 -    SDL_Unsupported();
   6.632 -    return -1;
   6.633 -}
   6.634 -
   6.635 -
   6.636 -
   6.637 -void WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height)
   6.638 -{
   6.639 -    const float maxW1 = (float)(GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) ? GetSystemMetrics(SM_CXSCREEN) : GetSystemMetrics(SM_CYSCREEN));
   6.640 -    const float maxW2 = (float)(data->fb.width > data->fb.height ? data->fb.width : data->fb.height);
   6.641 -
   6.642 -    // scale define
   6.643 -    data->scale = maxW2 / maxW1;
   6.644 -
   6.645 -    // init fb values
   6.646 -    FrameBufferInitialize(&data->fb);
   6.647 -
   6.648 -    // orientation values
   6.649 -    data->userOrientation = ORIENTATION_UP;
   6.650 -    data->systemOrientation = WINCE_GetDMOrientation();
   6.651 -    data->hardwareGeometry = data->fb.width == data->fb.height ? GEOMETRY_SQUARE :
   6.652 -                                (data->fb.width < data->fb.height ? GEOMETRY_PORTRAIT : GEOMETRY_LANDSCAPE);
   6.653 -
   6.654 -    if(data->debug)
   6.655 -        WINCE_DumpVideoInfo(data);
   6.656 -
   6.657 -    if(data->systemOrientation == ORIENTATION_UNKNOWN)
   6.658 -        data->systemOrientation = ORIENTATION_UP;
   6.659 -
   6.660 -    data->userOrientation = ORIENTATION_UP;
   6.661 -
   6.662 -    switch(data->hardwareGeometry)
   6.663 -    {
   6.664 -        case GEOMETRY_PORTRAIT:  WINCE_PortraitTransform(data, width, height); break;
   6.665 -        case GEOMETRY_LANDSCAPE: WINCE_LandscapeTransform(data, width, height); break;
   6.666 -        case GEOMETRY_SQUARE:    WINCE_SquareTransform(data, width, height); break;
   6.667 -        default: break;
   6.668 -    }
   6.669 -
   6.670 -    // debug
   6.671 -    if(data->debug)
   6.672 -    {
   6.673 -        printf("\n");
   6.674 -        printf("user video width:          %d\n", width);
   6.675 -        printf("user video height:         %d\n", height);
   6.676 -        FrameBufferDumpInfo(&data->fb, "user");
   6.677 -    }
   6.678 -}
   6.679 -
   6.680 -void WINCE_DumpVideoInfo(WINCE_RenderData* data)
   6.681 -{
   6.682 -    // get oem info
   6.683 -    WCHAR oemInfo[48];
   6.684 -    SDL_memset(oemInfo, 0, sizeof(oemInfo));
   6.685 -    SystemParametersInfo(SPI_GETOEMINFO, sizeof(oemInfo) - sizeof(WCHAR), oemInfo, 0);
   6.686 -
   6.687 -    printf("hardware oem: ");
   6.688 -    wprintf(oemInfo);
   6.689 -    printf("\n");
   6.690 -
   6.691 -    printf("video driver mode:             %s\n", (data->flags & FB_RAW_MODE ? RAW_RENDER_NAME : GAPI_RENDER_NAME));
   6.692 -    printf("GetSystemMetrics(SM_CXSCREEN): %d\n", GetSystemMetrics(SM_CXSCREEN));
   6.693 -    printf("GetSystemMetrics(SM_CYSCREEN): %d\n", GetSystemMetrics(SM_CYSCREEN));
   6.694 -    printf("scale coord:                   %f\n", data->scale);
   6.695 -
   6.696 -    FrameBufferDumpInfo(&data->fb, "hardware");
   6.697 -
   6.698 -    printf("display format:                %p\n", data->format);
   6.699 -    printf("display bits per pixel:        %d\n", SDL_BITSPERPIXEL(data->format));
   6.700 -    printf("display bytes per pixel:       %d\n", SDL_BYTESPERPIXEL(data->format));
   6.701 -    printf("display memory:                %p\n", data->pixels);
   6.702 -    printf("system orientation:            %d, %s\n", data->systemOrientation, GetOrientationName(data->systemOrientation));
   6.703 -    printf("hardware geometry:             %d\n", data->hardwareGeometry);
   6.704 -}
   6.705 -
   6.706 -void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible)
   6.707 -{
   6.708 -    SDL_WindowData* windowdata = (SDL_WindowData*) window->driverdata;
   6.709 -    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
   6.710 -    SDL_Renderer* renderer = (SDL_Renderer*) window->renderer;
   6.711 -
   6.712 -    if(visible)
   6.713 -    {
   6.714 -        if(window->flags & SDL_WINDOW_FULLSCREEN)
   6.715 -        {
   6.716 -            if(videodata->SHFullScreen)
   6.717 -                videodata->SHFullScreen(windowdata->hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
   6.718 -            ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_HIDE);
   6.719 -        }
   6.720 -
   6.721 -        ShowWindow(windowdata->hwnd, SW_SHOW);
   6.722 -        SetForegroundWindow(windowdata->hwnd);
   6.723 -
   6.724 -        if(renderer &&
   6.725 -            (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
   6.726 -        {
   6.727 -            WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata;
   6.728 -            renderdata->flags &= ~FB_SUSPENDED;
   6.729 -            if(renderdata->gapi) renderdata->gapi->GXResume();
   6.730 -        }
   6.731 -    }
   6.732 -    else
   6.733 -    {
   6.734 -        if(renderer &&
   6.735 -            (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
   6.736 -        {
   6.737 -            WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata;
   6.738 -            if(renderdata->gapi) renderdata->gapi->GXSuspend();
   6.739 -            renderdata->flags |= FB_SUSPENDED;
   6.740 -        }
   6.741 -
   6.742 -        ShowWindow(windowdata->hwnd, SW_HIDE);
   6.743 -
   6.744 -        if(window->flags & SDL_WINDOW_FULLSCREEN)
   6.745 -        {
   6.746 -            if(videodata->SHFullScreen)
   6.747 -                videodata->SHFullScreen(windowdata->hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
   6.748 -            ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_SHOW);
   6.749 -        }
   6.750 -    }
   6.751 -}
   6.752 -
   6.753 -
   6.754 -void WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt)
   6.755 -{
   6.756 -    WINCE_RenderData* data = (WINCE_RenderData*) window->renderer->driverdata;
   6.757 -
   6.758 -    pt->x = (LONG)(pt->x * data->scale);
   6.759 -    pt->y = (LONG)(pt->y * data->scale);
   6.760 -
   6.761 -    PointerRotate(pt, &data->fb, data->userOrientation);
   6.762 -}
   6.763 -
   6.764 -void WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height)
   6.765 -{
   6.766 -    if(data->systemOrientation != ORIENTATION_UP)
   6.767 -        FrameBufferRotate(&data->fb, data->systemOrientation);
   6.768 -
   6.769 -    if(data->fb.width != width || data->fb.height != height) {
   6.770 -        switch(data->systemOrientation)
   6.771 -        {
   6.772 -            case ORIENTATION_UP:
   6.773 -            case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break;
   6.774 -            case ORIENTATION_RIGHT:
   6.775 -            case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break;
   6.776 -            default: break;
   6.777 -        }
   6.778 -    }
   6.779 -
   6.780 -    if(data->userOrientation != ORIENTATION_UP)
   6.781 -        FrameBufferRotate(&data->fb, data->userOrientation);
   6.782 -}
   6.783 -
   6.784 -void WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height)
   6.785 -{
   6.786 -    switch(data->systemOrientation)
   6.787 -    {
   6.788 -        case ORIENTATION_UP:  FrameBufferRotate(&data->fb, ORIENTATION_LEFT); break;
   6.789 -        case ORIENTATION_LEFT:FrameBufferRotate(&data->fb, ORIENTATION_DOWN); break;
   6.790 -        case ORIENTATION_DOWN:FrameBufferRotate(&data->fb, ORIENTATION_RIGHT); break;
   6.791 -        default: break;
   6.792 -    }
   6.793 -
   6.794 -    if(data->fb.width != width || data->fb.height != height)
   6.795 -    switch(data->systemOrientation)
   6.796 -    {
   6.797 -        case ORIENTATION_UP:
   6.798 -        case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break;
   6.799 -        case ORIENTATION_RIGHT:
   6.800 -        case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break;
   6.801 -        default: break;
   6.802 -    }
   6.803 -
   6.804 -    if(data->userOrientation != ORIENTATION_UP)
   6.805 -        FrameBufferRotate(&data->fb, data->userOrientation);
   6.806 -}
   6.807 -
   6.808 -void WINCE_SquareTransform(WINCE_RenderData* data, int width, int height)
   6.809 -{
   6.810 -    WINCE_PortraitTransform(data, width, height);
   6.811 -}
   6.812 -
   6.813 -int WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug)
   6.814 -{
   6.815 -    // check square
   6.816 -    if(GetSystemMetrics(SM_CXSCREEN) == GetSystemMetrics(SM_CYSCREEN) &&
   6.817 -        fb->width != fb->height)
   6.818 -    {
   6.819 -        if(fb->width < fb->height)
   6.820 -            fb->height = fb->width;
   6.821 -        else
   6.822 -        if(fb->height < fb->width)
   6.823 -            fb->width = fb->height;
   6.824 -    }
   6.825 -
   6.826 -    // check width
   6.827 -    if(__abs(fb->xpitch) == bpp &&
   6.828 -        fb->width  != __abs(fb->ypitch) / bpp)
   6.829 -    {
   6.830 -        if(fb->height == __abs(fb->ypitch) / bpp)
   6.831 -            {
   6.832 -            __swap(&fb->width, &fb->height);
   6.833 -
   6.834 -            if(debug)
   6.835 -                printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height);
   6.836 -        }
   6.837 -        else
   6.838 -            return -1;
   6.839 -    }
   6.840 -    else
   6.841 -    // check height
   6.842 -    if(__abs(fb->ypitch) == bpp &&
   6.843 -        fb->height != __abs(fb->xpitch) / bpp)
   6.844 -    {
   6.845 -        if(fb->width  == __abs(fb->xpitch) / bpp)
   6.846 -            {
   6.847 -            __swap(&fb->width, &fb->height);
   6.848 -
   6.849 -            if(debug)
   6.850 -                printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height);
   6.851 -        }
   6.852 -        else
   6.853 -            return -1;
   6.854 -    }
   6.855 -
   6.856 -    return 0;
   6.857 -}
   6.858 -
   6.859 -void WINCE_UpdateYUVTextureData(SDL_Texture* texture)
   6.860 -{
   6.861 -    WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata;
   6.862 -    SDL_Rect rect;
   6.863 -
   6.864 -    rect.x = 0;
   6.865 -    rect.y = 0;
   6.866 -    rect.w = texture->w;
   6.867 -    rect.h = texture->h;
   6.868 -    SDL_SW_CopyYUVToRGB(texturedata->yuv, &rect, texturedata->format, texture->w, texture->h, texturedata->pixels, texturedata->pitch);
   6.869 -}
   6.870 -
   6.871 -int GAPI_Init(WINCE_RenderData* data, HWND hwnd)
   6.872 -{
   6.873 -    if(NULL == data->gapi)
   6.874 -    {
   6.875 -        struct GXDisplayProperties gxProperties;
   6.876 -        GXDeviceInfo gxInfo = { 0 };
   6.877 -        HDC hdc;
   6.878 -        int enable, result;
   6.879 -        const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
   6.880 -        if(preferably && 0 != SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0;
   6.881 -
   6.882 -        data->gapi = (GapiInfo *) SDL_calloc(1, sizeof(GapiInfo));
   6.883 -        if(NULL == data->gapi)
   6.884 -        {
   6.885 -            SDL_OutOfMemory();
   6.886 -            return 0;
   6.887 -        }
   6.888 -
   6.889 -        data->gapi->hGapiLib = SDL_LoadObject("\\Windows\\gx.dll");
   6.890 -        if(0 == data->gapi->hGapiLib)
   6.891 -        {
   6.892 -            data->gapi->hGapiLib = SDL_LoadObject("gx.dll");
   6.893 -            if(0 == data->gapi->hGapiLib) return 0;
   6.894 -        }
   6.895 -
   6.896 -        // load gapi library
   6.897 -#define LINK(type,name,import) name=(PFN##type)SDL_LoadFunction(data->gapi->hGapiLib,import)
   6.898 -        LINK(GXOpenDisplay,         data->gapi->GXOpenDisplay,         "?GXOpenDisplay@@YAHPAUHWND__@@K@Z");
   6.899 -        LINK(GXCloseDisplay,        data->gapi->GXCloseDisplay,        "?GXCloseDisplay@@YAHXZ");
   6.900 -        LINK(GXBeginDraw,           data->gapi->GXBeginDraw,           "?GXBeginDraw@@YAPAXXZ");
   6.901 -        LINK(GXEndDraw,             data->gapi->GXEndDraw,             "?GXEndDraw@@YAHXZ");
   6.902 -        LINK(GXGetDisplayProperties,data->gapi->GXGetDisplayProperties,"?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ");
   6.903 -        LINK(GXSuspend,             data->gapi->GXSuspend,             "?GXSuspend@@YAHXZ");
   6.904 -        LINK(GXResume,              data->gapi->GXResume,              "?GXResume@@YAHXZ");
   6.905 -#undef LINK
   6.906 -
   6.907 -        enable = data->gapi->GXGetDisplayProperties && data->gapi->GXCloseDisplay && data->gapi->GXOpenDisplay &&
   6.908 -            data->gapi->GXBeginDraw && data->gapi->GXEndDraw && data->gapi->GXSuspend && data->gapi->GXResume;
   6.909 -
   6.910 -        if(!enable)
   6.911 -        {
   6.912 -            SDL_SetError("GAPI_Init: error gx.dll: internal error");
   6.913 -            GAPI_Quit(data);
   6.914 -            return 0;
   6.915 -        }
   6.916 -
   6.917 -        if(0 == data->gapi->GXOpenDisplay(hwnd, GX_FULLSCREEN))
   6.918 -        {
   6.919 -            SDL_SetError("GAPI_Init: couldn't initialize GAPI");
   6.920 -            GAPI_Quit(data);
   6.921 -            return 0;
   6.922 -        }
   6.923 -
   6.924 -        gxProperties = data->gapi->GXGetDisplayProperties();
   6.925 -
   6.926 -        // fill FrameBufferInfo
   6.927 -        data->fb.xpitch = gxProperties.cbxPitch;
   6.928 -        data->fb.ypitch = gxProperties.cbyPitch;
   6.929 -        data->fb.width  = gxProperties.cxWidth;
   6.930 -        data->fb.height = gxProperties.cyHeight;
   6.931 -        data->fb.offset = 0;
   6.932 -
   6.933 -        if((gxProperties.ffFormat & kfDirect565) || 16 == gxProperties.cBPP)
   6.934 -            data->format = SDL_PIXELFORMAT_RGB565;
   6.935 -        else
   6.936 -        if((gxProperties.ffFormat & kfDirect555) || 15 == gxProperties.cBPP)
   6.937 -            data->format = SDL_PIXELFORMAT_RGB555;
   6.938 -        else
   6.939 -            data->format = 0;
   6.940 -
   6.941 -        // get pixels
   6.942 -        hdc = GetDC(NULL);
   6.943 -
   6.944 -        gxInfo.Version = 100;
   6.945 -        result = ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), (char *) &gxInfo);
   6.946 -        ReleaseDC(NULL, hdc);
   6.947 -
   6.948 -        if(result > 0)
   6.949 -        {
   6.950 -            // more debug
   6.951 -            if(data->debug)
   6.952 -            {
   6.953 -                int i;
   6.954 -
   6.955 -                printf("GXDeviceInfo.pvFrameBuffer:    %p\n", gxInfo.pvFrameBuffer);
   6.956 -                printf("GXDeviceInfo.cxWidth:          %d\n", gxInfo.cxWidth);
   6.957 -                printf("GXDeviceInfo.cyHeight:         %d\n", gxInfo.cyHeight);
   6.958 -                printf("GXDeviceInfo.cbStride:         %d\n", gxInfo.cbStride);
   6.959 -                printf("GXDeviceInfo.cBPP:             %d\n", gxInfo.cBPP);
   6.960 -                printf("GXDeviceInfo.ffFormat:        0x%x\n", gxInfo.ffFormat);
   6.961 -
   6.962 -                printf("GXDeviceInfo.unk:\n");
   6.963 -                for(i = 0; i <  sizeof(gxInfo.unknown); ++i)
   6.964 -                    printf("0x%02hhX,", gxInfo.unknown[i]);
   6.965 -                printf("\n");
   6.966 -            }
   6.967 -
   6.968 -                if(gxInfo.ffFormat && gxInfo.ffFormat != gxProperties.ffFormat) {
   6.969 -                    if((gxInfo.ffFormat & kfDirect565) || 16 == gxInfo.cBPP)
   6.970 -                        data->format = SDL_PIXELFORMAT_RGB565;
   6.971 -                    else
   6.972 -                    if((gxInfo.ffFormat & kfDirect555) || 15 == gxInfo.cBPP)
   6.973 -                        data->format = SDL_PIXELFORMAT_RGB555;
   6.974 -                }
   6.975 -
   6.976 -                data->pixels = gxInfo.pvFrameBuffer;
   6.977 -        }
   6.978 -        else
   6.979 -        {
   6.980 -            data->flags |= FB_SKIP_OFFSET;
   6.981 -            data->pixels = data->gapi->GXBeginDraw();
   6.982 -            data->gapi->GXEndDraw();
   6.983 -
   6.984 -            if(data->debug)
   6.985 -            {
   6.986 -                printf("GAPI_Init\n");
   6.987 -                printf("use GXBeginDraw:               %p\n", data->pixels);
   6.988 -                printf("use skip offset\n");
   6.989 -            }
   6.990 -        }
   6.991 -
   6.992 -        if(0 == data->format ||
   6.993 -            0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug))
   6.994 -        {
   6.995 -            SDL_SetError("GAPI_Init: unknown hardware");
   6.996 -            GAPI_Quit(data);
   6.997 -            return 0;
   6.998 -        }
   6.999 -    }
  6.1000 -
  6.1001 -    return data->gapi && data->pixels ? 1 : 0;
  6.1002 -}
  6.1003 -
  6.1004 -void GAPI_Quit(WINCE_RenderData* data)
  6.1005 -{
  6.1006 -    if(data->gapi)
  6.1007 -    {
  6.1008 -        if(data->gapi->GXCloseDisplay) data->gapi->GXCloseDisplay(); 
  6.1009 -        if(data->gapi->hGapiLib)  SDL_UnloadObject(data->gapi->hGapiLib);
  6.1010 -
  6.1011 -        SDL_free(data->gapi);
  6.1012 -        data->gapi = NULL;
  6.1013 -    }
  6.1014 -}
  6.1015 -
  6.1016 -int RAW_Init(WINCE_RenderData* data)
  6.1017 -{
  6.1018 -    RawFrameBufferInfo rfbi = { 0 };
  6.1019 -    HDC hdc;
  6.1020 -    int result;
  6.1021 -    const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER");
  6.1022 -    if(preferably && 0 != SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0;
  6.1023 -
  6.1024 -    hdc = GetDC(NULL);
  6.1025 -    result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi);
  6.1026 -    ReleaseDC(NULL, hdc);
  6.1027 -
  6.1028 -    //disable
  6.1029 -    if(result == 0 || rfbi.pFramePointer == 0 ||
  6.1030 -            rfbi.cxPixels == 0 || rfbi.cyPixels == 0 ||
  6.1031 -        rfbi.cxStride == 0 || rfbi.cyStride == 0) return 0;
  6.1032 -
  6.1033 -    data->flags     = FB_RAW_MODE;
  6.1034 -
  6.1035 -    // fill FrameBufferInfo
  6.1036 -    SDL_memset(&data->fb, 0, sizeof(FrameBufferInfo));
  6.1037 -
  6.1038 -    data->fb.xpitch = rfbi.cxStride;
  6.1039 -    data->fb.ypitch = rfbi.cyStride;
  6.1040 -    data->fb.width  = rfbi.cxPixels;
  6.1041 -    data->fb.height = rfbi.cyPixels;
  6.1042 -    data->fb.offset = 0;
  6.1043 -
  6.1044 -    if((FORMAT_565 & rfbi.wFormat) || 16 == rfbi.wBPP)
  6.1045 -        data->format = SDL_PIXELFORMAT_RGB565;
  6.1046 -    else
  6.1047 -    if((FORMAT_555 & rfbi.wFormat) || 15 == rfbi.wBPP)
  6.1048 -        data->format = SDL_PIXELFORMAT_RGB555;
  6.1049 -    else
  6.1050 -        data->format = 0;
  6.1051 -
  6.1052 -    if(0 == data->format ||
  6.1053 -        0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug))
  6.1054 -    {
  6.1055 -        SDL_SetError("RAW_Init: unknown hardware");
  6.1056 -        RAW_Quit(data);
  6.1057 -        return 0;
  6.1058 -    }
  6.1059 -
  6.1060 -    data->pixels = rfbi.pFramePointer;
  6.1061 -
  6.1062 -    return data->pixels ? 1 : 0;
  6.1063 -}
  6.1064 -
  6.1065 -void RAW_Quit(WINCE_RenderData* data)
  6.1066 -{
  6.1067 -}
  6.1068 -
  6.1069 -void FrameBufferInitialize(FrameBufferInfo* fb)
  6.1070 -{
  6.1071 -    int orientation = GetFrameBufferOrientation(fb);
  6.1072 -
  6.1073 -    // set correct start offset
  6.1074 -    switch(orientation)
  6.1075 -    {
  6.1076 -        case ORIENTATION_UP:
  6.1077 -            fb->offset = 0;
  6.1078 -            break;
  6.1079 -
  6.1080 -        case ORIENTATION_LEFT:
  6.1081 -            fb->offset = __abs(fb->ypitch * (fb->height - 1));
  6.1082 -            break;
  6.1083 -
  6.1084 -        case ORIENTATION_RIGHT:
  6.1085 -            fb->offset = __abs(fb->xpitch * (fb->width - 1));
  6.1086 -            break;
  6.1087 -
  6.1088 -        case ORIENTATION_DOWN:
  6.1089 -            fb->offset = __abs(fb->xpitch * (fb->width - 1) +
  6.1090 -                                fb->ypitch * (fb->height - 1));
  6.1091 -            break;
  6.1092 -
  6.1093 -        default: break;
  6.1094 -    }
  6.1095 -
  6.1096 -    //if(orientation != ORIENTATION_UP)
  6.1097 -    switch(orientation)
  6.1098 -    {
  6.1099 -        case ORIENTATION_LEFT: FrameBufferRotate(fb, ORIENTATION_RIGHT); break;
  6.1100 -        case ORIENTATION_RIGHT:FrameBufferRotate(fb, ORIENTATION_LEFT); break;
  6.1101 -        case ORIENTATION_DOWN: FrameBufferRotate(fb, ORIENTATION_DOWN); break;
  6.1102 -
  6.1103 -        default: break;
  6.1104 -    }
  6.1105 -}
  6.1106 -
  6.1107 -int GetFrameBufferOrientation(const FrameBufferInfo* src)
  6.1108 -{
  6.1109 -    if(src->xpitch > 0 && src->ypitch > 0)
  6.1110 -        return ORIENTATION_UP;
  6.1111 -    else
  6.1112 -    if(src->xpitch > 0 && src->ypitch < 0)
  6.1113 -        return ORIENTATION_LEFT;
  6.1114 -    else
  6.1115 -    if(src->xpitch < 0 && src->ypitch > 0)
  6.1116 -        return ORIENTATION_RIGHT;
  6.1117 -    else
  6.1118 -    if(src->xpitch < 0 && src->ypitch < 0)
  6.1119 -        return ORIENTATION_DOWN;
  6.1120 -
  6.1121 -    return ORIENTATION_UNKNOWN;
  6.1122 -}
  6.1123 -
  6.1124 -void FrameBufferRotate(FrameBufferInfo* dst, int orientation)
  6.1125 -{
  6.1126 -    FrameBufferInfo src;
  6.1127 -    // copy dst -> src
  6.1128 -    SDL_memcpy(&src, dst, sizeof(FrameBufferInfo));
  6.1129 -
  6.1130 -    switch(orientation)
  6.1131 -    {
  6.1132 -        case ORIENTATION_LEFT:
  6.1133 -            dst->width  = src.height;
  6.1134 -            dst->height = src.width;
  6.1135 -            dst->xpitch = src.ypitch;
  6.1136 -            dst->ypitch = -src.xpitch;
  6.1137 -            dst->offset = src.offset + src.xpitch * (src.width - 1);
  6.1138 -            break;
  6.1139 -
  6.1140 -        case ORIENTATION_RIGHT:
  6.1141 -            dst->width  = src.height;
  6.1142 -            dst->height = src.width;
  6.1143 -            dst->xpitch = -src.ypitch;
  6.1144 -            dst->ypitch = src.xpitch;
  6.1145 -            dst->offset = src.offset + src.ypitch * (src.height - 1);
  6.1146 -            break;
  6.1147 -
  6.1148 -        case ORIENTATION_DOWN:
  6.1149 -            FrameBufferRotate(dst, ORIENTATION_LEFT);
  6.1150 -            FrameBufferRotate(dst, ORIENTATION_LEFT);
  6.1151 -            break;
  6.1152 -
  6.1153 -        default:
  6.1154 -            break;
  6.1155 -    }
  6.1156 -}
  6.1157 -
  6.1158 -void PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation)
  6.1159 -{
  6.1160 -    switch(orientation)
  6.1161 -    {
  6.1162 -        case ORIENTATION_UP:
  6.1163 -            break;
  6.1164 -
  6.1165 -        case ORIENTATION_LEFT:
  6.1166 -        {
  6.1167 -            int temp = pt->y;
  6.1168 -            pt->y = fb->height - pt->x;
  6.1169 -            pt->x = temp;
  6.1170 -        }
  6.1171 -            break;
  6.1172 -
  6.1173 -        case ORIENTATION_RIGHT:
  6.1174 -        {
  6.1175 -            int temp = pt->x;
  6.1176 -            pt->x = fb->width - pt->y;
  6.1177 -            pt->y = temp;
  6.1178 -        }
  6.1179 -            break;
  6.1180 -
  6.1181 -        case ORIENTATION_DOWN:
  6.1182 -            pt->x = fb->width  - pt->x;
  6.1183 -            pt->y = fb->height - pt->y;
  6.1184 -            break;
  6.1185 -
  6.1186 -        default: break;
  6.1187 -    }
  6.1188 -}
  6.1189 -
  6.1190 -const char* GetOrientationName(int orientation)
  6.1191 -{
  6.1192 -    switch(orientation)
  6.1193 -    {
  6.1194 -        case ORIENTATION_UP:        return "UP";
  6.1195 -        case ORIENTATION_DOWN:      return "DOWN";
  6.1196 -        case ORIENTATION_LEFT:      return "LEFT";
  6.1197 -        case ORIENTATION_RIGHT:     return "RIGHT";
  6.1198 -        default: break;
  6.1199 -    }
  6.1200 -
  6.1201 -    return "UNKNOWN";
  6.1202 -}
  6.1203 -
  6.1204 -int WINCE_GetDMOrientation(void)
  6.1205 -{
  6.1206 -    DEVMODE sDevMode = {0};
  6.1207 -    sDevMode.dmSize = sizeof(DEVMODE);
  6.1208 -    sDevMode.dmFields = DM_DISPLAYORIENTATION;
  6.1209 -
  6.1210 -    // DMDO_0, DMDO_90, DMDO_180, DMDO_270
  6.1211 -    if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_TEST, NULL))
  6.1212 -        switch(sDevMode.dmDisplayOrientation)
  6.1213 -        {
  6.1214 -            case DMDO_0:        return DMDO_0;
  6.1215 -            case DMDO_90:        return DMDO_90;
  6.1216 -            case DMDO_180:        return DMDO_180;
  6.1217 -            case DMDO_270:        return DMDO_270;
  6.1218 -            default: break;
  6.1219 -        }
  6.1220 -
  6.1221 -    SDL_SetError("WINCE_GetDMOrientation: ChangeDisplaySettingsEx return BADMODE");
  6.1222 -    return -1;
  6.1223 -}
  6.1224 -
  6.1225 -int WINCE_SetDMOrientation(int orientation)
  6.1226 -{
  6.1227 -    DEVMODE sDevMode = {0};
  6.1228 -    sDevMode.dmSize = sizeof(DEVMODE);
  6.1229 -    sDevMode.dmFields = DM_DISPLAYORIENTATION;
  6.1230 -
  6.1231 -    switch(orientation)
  6.1232 -    {
  6.1233 -        case DMDO_0:        sDevMode.dmDisplayOrientation = DMDO_0;   break;
  6.1234 -        case DMDO_90:        sDevMode.dmDisplayOrientation = DMDO_90;  break;
  6.1235 -        case DMDO_180:        sDevMode.dmDisplayOrientation = DMDO_180; break;
  6.1236 -        case DMDO_270:        sDevMode.dmDisplayOrientation = DMDO_270; break;
  6.1237 -        default: return 0;
  6.1238 -    }
  6.1239 -
  6.1240 -    if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_RESET, NULL))
  6.1241 -        return 1;
  6.1242 -
  6.1243 -    SDL_SetError("WINCE_SetDMOrientation: ChangeDisplaySettingsEx return BADMODE");
  6.1244 -    return -1;
  6.1245 -}
  6.1246 -
  6.1247 -void FrameBufferDumpInfo(const FrameBufferInfo* fb, const char* name)
  6.1248 -{
  6.1249 -    int orientation;
  6.1250 -
  6.1251 -    printf("%s fb.width:       %d\n", name, fb->width);
  6.1252 -    printf("%s fb.height:      %d\n", name, fb->height);
  6.1253 -    printf("%s fb.xpitch:      %d\n", name, fb->xpitch);
  6.1254 -    printf("%s fb.ypitch:      %d\n", name, fb->ypitch);
  6.1255 -    printf("%s fb.offset:      %d\n", name, fb->offset);
  6.1256 -
  6.1257 -    orientation = GetFrameBufferOrientation(fb);
  6.1258 -    printf("%s fb.orientation: %d, %s\n", name, orientation, GetOrientationName(orientation));
  6.1259 -}
  6.1260 -
  6.1261 -void UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width)
  6.1262 -{
  6.1263 -    if(2 == fb->xpitch)
  6.1264 -    {
  6.1265 -        switch(width)
  6.1266 -        {
  6.1267 -            case 1:
  6.1268 -                *dst = *src;
  6.1269 -                break;
  6.1270 -
  6.1271 -            case 2:
  6.1272 -                *((Uint32*) dst) = *((Uint32*) src);
  6.1273 -                break;
  6.1274 -
  6.1275 -            default:
  6.1276 -                SDL_memcpy(dst, src, width * 2);
  6.1277 -                break;
  6.1278 -        }
  6.1279 -    }
  6.1280 -    else
  6.1281 -    if(-2 == fb->xpitch)
  6.1282 -    {
  6.1283 -        while(width--)
  6.1284 -            *dst-- = *src++;
  6.1285 -    }
  6.1286 -    else
  6.1287 -    {
  6.1288 -        while(width--)
  6.1289 -        {
  6.1290 -            *dst = *src++;
  6.1291 -            dst += fb->xpitch / 2;
  6.1292 -        }
  6.1293 -    }
  6.1294 -}
  6.1295 -
  6.1296 -#endif // SDL_VIDEO_RENDER_GAPI
     7.1 --- a/src/video/windows/SDL_gapirender.h	Mon Jan 31 22:44:43 2011 -0800
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,37 +0,0 @@
     7.4 -/*
     7.5 -    SDL - Simple DirectMedia Layer
     7.6 -    Copyright (C) 1997-2010 Sam Lantinga
     7.7 -
     7.8 -    This library is free software; you can redistribute it and/or
     7.9 -    modify it under the terms of the GNU Lesser General Public
    7.10 -    License as published by the Free Software Foundation; either
    7.11 -    version 2.1 of the License, or (at your option) any later version.
    7.12 -
    7.13 -    This library is distributed in the hope that it will be useful,
    7.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.16 -    Lesser General Public License for more details.
    7.17 -
    7.18 -    You should have received a copy of the GNU Lesser General Public
    7.19 -    License along with this library; if not, write to the Free Software
    7.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    7.21 -
    7.22 -    Sam Lantinga
    7.23 -    slouken@libsdl.org
    7.24 -    
    7.25 -    Stefan Klug
    7.26 -    klug.stefan@gmx.de
    7.27 -*/
    7.28 -#include "SDL_config.h"
    7.29 -
    7.30 -/* SDL surface based renderer implementation */
    7.31 -
    7.32 -#if SDL_VIDEO_RENDER_GAPI
    7.33 -extern void WINCE_AddRenderDriver(_THIS);
    7.34 -extern int  WINCE_Available(void);
    7.35 -extern void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible);
    7.36 -extern int  WINCE_GetDMOrientation(void);
    7.37 -extern int  WINCE_SetDMOrientation(int orientation);
    7.38 -#endif
    7.39 -
    7.40 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/video/windows/SDL_gapirender_c.h	Mon Jan 31 22:44:43 2011 -0800
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,24 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997-2010 Sam Lantinga
     8.7 -
     8.8 -    This library is free software; you can redistribute it and/or
     8.9 -    modify it under the terms of the GNU Lesser General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2.1 of the License, or (at your option) any later version.
    8.12 -
    8.13 -    This library is distributed in the hope that it will be useful,
    8.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 -    Lesser General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Lesser General Public
    8.19 -    License along with this library; if not, write to the Free Software
    8.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    slouken@libsdl.org
    8.24 -    
    8.25 -    Stefan Klug
    8.26 -    klug.stefan@gmx.de
    8.27 -*/
     9.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Jan 31 22:44:43 2011 -0800
     9.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Jan 31 22:53:45 2011 -0800
     9.3 @@ -195,14 +195,12 @@
     9.4          /* transform coords for VGA, WVGA... */
     9.5          {
     9.6              SDL_VideoData *videodata = data->videodata;
     9.7 -            if(videodata->CoordTransform &&
     9.8 -                (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW))
     9.9 -            {
    9.10 +            if(videodata->CoordTransform) {
    9.11                  POINT pt;
    9.12                  pt.x = LOWORD(lParam);
    9.13                  pt.y = HIWORD(lParam);
    9.14                  videodata->CoordTransform(data->window, &pt);
    9.15 -                    SDL_SendMouseMotion(data->window, 0, pt.x, pt.y);
    9.16 +                SDL_SendMouseMotion(data->window, 0, pt.x, pt.y);
    9.17                  break;
    9.18              }
    9.19          }
    10.1 --- a/src/video/windows/SDL_windowsvideo.c	Mon Jan 31 22:44:43 2011 -0800
    10.2 +++ b/src/video/windows/SDL_windowsvideo.c	Mon Jan 31 22:53:45 2011 -0800
    10.3 @@ -30,7 +30,6 @@
    10.4  #include "SDL_windowsvideo.h"
    10.5  #include "SDL_windowsshape.h"
    10.6  #include "SDL_d3drender.h"
    10.7 -#include "SDL_gapirender.h"
    10.8  
    10.9  /* Initialization/Query functions */
   10.10  static int WIN_VideoInit(_THIS);
   10.11 @@ -57,12 +56,6 @@
   10.12          SDL_UnloadObject(data->d3dDLL);
   10.13      }
   10.14  #endif
   10.15 -#if SDL_VIDEO_RENDER_DDRAW
   10.16 -    if (data->ddraw) {
   10.17 -        data->ddraw->lpVtbl->Release(data->ddraw);
   10.18 -        SDL_UnloadObject(data->ddrawDLL);
   10.19 -    }
   10.20 -#endif
   10.21  #ifdef _WIN32_WCE
   10.22      if(data->hAygShell) {
   10.23         SDL_UnloadObject(data->hAygShell);
   10.24 @@ -100,42 +93,6 @@
   10.25      }
   10.26      device->driverdata = data;
   10.27  
   10.28 -#if SDL_VIDEO_RENDER_D3D
   10.29 -    data->d3dDLL = SDL_LoadObject("D3D9.DLL");
   10.30 -    if (data->d3dDLL) {
   10.31 -        IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion);
   10.32 -
   10.33 -        D3DCreate =
   10.34 -            (IDirect3D9 * (WINAPI *) (UINT)) SDL_LoadFunction(data->d3dDLL,
   10.35 -                                                            "Direct3DCreate9");
   10.36 -        if (D3DCreate) {
   10.37 -            data->d3d = D3DCreate(D3D_SDK_VERSION);
   10.38 -        }
   10.39 -        if (!data->d3d) {
   10.40 -            SDL_UnloadObject(data->d3dDLL);
   10.41 -            data->d3dDLL = NULL;
   10.42 -        }
   10.43 -    }
   10.44 -#endif /* SDL_VIDEO_RENDER_D3D */
   10.45 -#if SDL_VIDEO_RENDER_DDRAW
   10.46 -    data->ddrawDLL = SDL_LoadObject("ddraw.dll");
   10.47 -    if (data->ddrawDLL) {
   10.48 -        IDirectDraw *(WINAPI * DDCreate) (GUID FAR * lpGUID,
   10.49 -                                          LPDIRECTDRAW FAR * lplpDD,
   10.50 -                                          IUnknown FAR * pUnkOuter);
   10.51 -
   10.52 -        DDCreate =
   10.53 -            (IDirectDraw *
   10.54 -             (WINAPI *) (GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *))
   10.55 -            SDL_LoadFunction(data->ddrawDLL, "DirectDrawCreate");
   10.56 -        if (!DDCreate || DDCreate(NULL, &data->ddraw, NULL) != DD_OK) {
   10.57 -            SDL_UnloadObject(data->ddrawDLL);
   10.58 -            data->ddrawDLL = NULL;
   10.59 -            data->ddraw = NULL;
   10.60 -        }
   10.61 -    }
   10.62 -#endif /* SDL_VIDEO_RENDER_DDRAW */
   10.63 -
   10.64  #ifdef _WIN32_WCE
   10.65      data->hAygShell = SDL_LoadObject("\\windows\\aygshell.dll");
   10.66      if(0 == data->hAygShell)
   10.67 @@ -221,12 +178,6 @@
   10.68  #if SDL_VIDEO_RENDER_D3D
   10.69      D3D_AddRenderDriver(_this);
   10.70  #endif
   10.71 -#if SDL_VIDEO_RENDER_DDRAW
   10.72 -    DDRAW_AddRenderDriver(_this);
   10.73 -#endif
   10.74 -#if SDL_VIDEO_RENDER_GAPI
   10.75 -    WINCE_AddRenderDriver(_this);
   10.76 -#endif
   10.77  
   10.78      WIN_InitKeyboard(_this);
   10.79      WIN_InitMouse(_this);
    11.1 --- a/src/video/windows/SDL_windowsvideo.h	Mon Jan 31 22:44:43 2011 -0800
    11.2 +++ b/src/video/windows/SDL_windowsvideo.h	Mon Jan 31 22:53:45 2011 -0800
    11.3 @@ -45,12 +45,6 @@
    11.4  #include "d3d9.h"
    11.5  #endif
    11.6  
    11.7 -#if SDL_VIDEO_RENDER_DDRAW
    11.8 -/* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
    11.9 -#include <objbase.h>
   11.10 -#include "ddraw.h"
   11.11 -#endif
   11.12 -
   11.13  #include "SDL_windowsclipboard.h"
   11.14  #include "SDL_windowsevents.h"
   11.15  #include "SDL_windowsgamma.h"
   11.16 @@ -63,7 +57,7 @@
   11.17  #include "SDL_loadso.h"
   11.18  
   11.19  
   11.20 -enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW };
   11.21 +enum { RENDER_NONE, RENDER_D3D };
   11.22  
   11.23  #if WINVER < 0x0601
   11.24  /* Touch input definitions */
   11.25 @@ -135,10 +129,6 @@
   11.26      void* d3dDLL;
   11.27      IDirect3D9 *d3d;
   11.28  #endif
   11.29 -#if SDL_VIDEO_RENDER_DDRAW
   11.30 -    void* ddrawDLL;
   11.31 -    IDirectDraw *ddraw;
   11.32 -#endif
   11.33  #ifdef _WIN32_WCE
   11.34      void* hAygShell;
   11.35      PFNSHFullScreen SHFullScreen;
    12.1 --- a/src/video/windows/SDL_windowswindow.c	Mon Jan 31 22:44:43 2011 -0800
    12.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Jan 31 22:53:45 2011 -0800
    12.3 @@ -30,7 +30,6 @@
    12.4  
    12.5  /* This is included after SDL_windowsvideo.h, which includes windows.h */
    12.6  #include "SDL_syswm.h"
    12.7 -#include "SDL_gapirender.h"
    12.8  
    12.9  /* Windows CE compatibility */
   12.10  #ifndef SWP_NOCOPYBITS