diff src/video/SDL_renderer_sw.c @ 1678:90bf530ced8e SDL-1.3

SDL_SetVideoMode() compiles now...
author Sam Lantinga <slouken@libsdl.org>
date Wed, 14 Jun 2006 06:14:26 +0000
parents e136f3ffdc1b
children 9488fca10677
line wrap: on
line diff
--- a/src/video/SDL_renderer_sw.c	Tue Jun 13 04:37:45 2006 +0000
+++ b/src/video/SDL_renderer_sw.c	Wed Jun 14 06:14:26 2006 +0000
@@ -30,6 +30,9 @@
 static SDL_Renderer *SDL_SW_CreateRenderer(SDL_Window * window, Uint32 flags);
 static int SDL_SW_CreateTexture(SDL_Renderer * renderer,
                                 SDL_Texture * texture);
+static int SDL_SW_QueryTexturePixels(SDL_Renderer * renderer,
+                                     SDL_Texture * texture, void **pixels,
+                                     int *pitch);
 static int SDL_SW_UpdateTexture(SDL_Renderer * renderer,
                                 SDL_Texture * texture, SDL_Rect * rect,
                                 const void *pixels, int pitch);
@@ -126,6 +129,7 @@
     SDL_zerop(data);
 
     renderer->CreateTexture = SDL_SW_CreateTexture;
+    renderer->QueryTexturePixels = SDL_SW_QueryTexturePixels;
     renderer->UpdateTexture = SDL_SW_UpdateTexture;
     renderer->LockTexture = SDL_SW_LockTexture;
     renderer->UnlockTexture = SDL_SW_UnlockTexture;
@@ -215,6 +219,17 @@
 }
 
 int
+SDL_SW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
+                          void **pixels, int *pitch)
+{
+    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
+
+    *pixels = surface->pixels;
+    *pitch = surface->pitch;
+    return 0;
+}
+
+int
 SDL_SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                      SDL_Rect * rect, const void *pixels, int pitch)
 {