src/video/SDL_renderer_sw.c
branchSDL-1.3
changeset 1678 90bf530ced8e
parent 1676 e136f3ffdc1b
child 1680 9488fca10677
     1.1 --- a/src/video/SDL_renderer_sw.c	Tue Jun 13 04:37:45 2006 +0000
     1.2 +++ b/src/video/SDL_renderer_sw.c	Wed Jun 14 06:14:26 2006 +0000
     1.3 @@ -30,6 +30,9 @@
     1.4  static SDL_Renderer *SDL_SW_CreateRenderer(SDL_Window * window, Uint32 flags);
     1.5  static int SDL_SW_CreateTexture(SDL_Renderer * renderer,
     1.6                                  SDL_Texture * texture);
     1.7 +static int SDL_SW_QueryTexturePixels(SDL_Renderer * renderer,
     1.8 +                                     SDL_Texture * texture, void **pixels,
     1.9 +                                     int *pitch);
    1.10  static int SDL_SW_UpdateTexture(SDL_Renderer * renderer,
    1.11                                  SDL_Texture * texture, SDL_Rect * rect,
    1.12                                  const void *pixels, int pitch);
    1.13 @@ -126,6 +129,7 @@
    1.14      SDL_zerop(data);
    1.15  
    1.16      renderer->CreateTexture = SDL_SW_CreateTexture;
    1.17 +    renderer->QueryTexturePixels = SDL_SW_QueryTexturePixels;
    1.18      renderer->UpdateTexture = SDL_SW_UpdateTexture;
    1.19      renderer->LockTexture = SDL_SW_LockTexture;
    1.20      renderer->UnlockTexture = SDL_SW_UnlockTexture;
    1.21 @@ -215,6 +219,17 @@
    1.22  }
    1.23  
    1.24  int
    1.25 +SDL_SW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
    1.26 +                          void **pixels, int *pitch)
    1.27 +{
    1.28 +    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
    1.29 +
    1.30 +    *pixels = surface->pixels;
    1.31 +    *pitch = surface->pitch;
    1.32 +    return 0;
    1.33 +}
    1.34 +
    1.35 +int
    1.36  SDL_SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    1.37                       SDL_Rect * rect, const void *pixels, int pitch)
    1.38  {