Playing around, trying to find a fast path with GDI
authorSam Lantinga <slouken@libsdl.org>
Wed, 12 Jul 2006 07:01:35 +0000
changeset 1898f89e49e51e89
parent 1897 c2a27da60b18
child 1899 6a11e61bf805
Playing around, trying to find a fast path with GDI
src/video/win32/SDL_d3drender.c
src/video/win32/SDL_gdirender.c
     1.1 --- a/src/video/win32/SDL_d3drender.c	Wed Jul 12 06:39:26 2006 +0000
     1.2 +++ b/src/video/win32/SDL_d3drender.c	Wed Jul 12 07:01:35 2006 +0000
     1.3 @@ -78,8 +78,10 @@
     1.4      SDL_D3D_CreateRenderer,
     1.5      {
     1.6       "d3d",
     1.7 -     (SDL_Renderer_PresentDiscard |
     1.8 -      SDL_Renderer_PresentCopy | SDL_Renderer_RenderTarget),
     1.9 +     (SDL_Renderer_Minimal |
    1.10 +      SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
    1.11 +      SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
    1.12 +      SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
    1.13       (SDL_TextureBlendMode_None |
    1.14        SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend),
    1.15       (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
     2.1 --- a/src/video/win32/SDL_gdirender.c	Wed Jul 12 06:39:26 2006 +0000
     2.2 +++ b/src/video/win32/SDL_gdirender.c	Wed Jul 12 07:01:35 2006 +0000
     2.3 @@ -79,7 +79,8 @@
     2.4      SDL_GDI_CreateRenderer,
     2.5      {
     2.6       "gdi",
     2.7 -     (SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
     2.8 +     (//SDL_Renderer_Minimal |
     2.9 +      SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
    2.10        SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
    2.11        SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
    2.12       (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
    2.13 @@ -491,13 +492,16 @@
    2.14      if (data->yuv) {
    2.15          return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels,
    2.16                                       pitch);
    2.17 -    } else {
    2.18 +    } else if (data->pixels) {
    2.19          GdiFlush();
    2.20          *pixels =
    2.21              (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
    2.22                        rect->x * SDL_BYTESPERPIXEL(texture->format));
    2.23          *pitch = data->pitch;
    2.24          return 0;
    2.25 +    } else {
    2.26 +        SDL_SetError("No pixels available");
    2.27 +        return -1;
    2.28      }
    2.29  }
    2.30