changeset 1898:f89e49e51e89

Playing around, trying to find a fast path with GDI
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jul 2006 07:01:35 +0000
parents c2a27da60b18
children 6a11e61bf805
files src/video/win32/SDL_d3drender.c src/video/win32/SDL_gdirender.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/win32/SDL_d3drender.c	Wed Jul 12 06:39:26 2006 +0000
+++ b/src/video/win32/SDL_d3drender.c	Wed Jul 12 07:01:35 2006 +0000
@@ -78,8 +78,10 @@
     SDL_D3D_CreateRenderer,
     {
      "d3d",
-     (SDL_Renderer_PresentDiscard |
-      SDL_Renderer_PresentCopy | SDL_Renderer_RenderTarget),
+     (SDL_Renderer_Minimal |
+      SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
+      SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
+      SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
      (SDL_TextureBlendMode_None |
       SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend),
      (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
--- a/src/video/win32/SDL_gdirender.c	Wed Jul 12 06:39:26 2006 +0000
+++ b/src/video/win32/SDL_gdirender.c	Wed Jul 12 07:01:35 2006 +0000
@@ -79,7 +79,8 @@
     SDL_GDI_CreateRenderer,
     {
      "gdi",
-     (SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
+     (//SDL_Renderer_Minimal |
+      SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
       SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
       SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
      (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
@@ -491,13 +492,16 @@
     if (data->yuv) {
         return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels,
                                      pitch);
-    } else {
+    } else if (data->pixels) {
         GdiFlush();
         *pixels =
             (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
                       rect->x * SDL_BYTESPERPIXEL(texture->format));
         *pitch = data->pitch;
         return 0;
+    } else {
+        SDL_SetError("No pixels available");
+        return -1;
     }
 }