src/render/software/SDL_render_sw.c
changeset 5224 2178ffe17222
parent 5195 bb45ecd958d8
child 5226 710d00cb3a6a
     1.1 --- a/src/render/software/SDL_render_sw.c	Mon Feb 07 20:05:52 2011 -0800
     1.2 +++ b/src/render/software/SDL_render_sw.c	Mon Feb 07 20:06:26 2011 -0800
     1.3 @@ -50,6 +50,7 @@
     1.4  static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
     1.5                            const SDL_Rect * rect, void **pixels, int *pitch);
     1.6  static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
     1.7 +static void SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
     1.8  static int SW_RenderDrawPoints(SDL_Renderer * renderer,
     1.9                                 const SDL_Point * points, int count);
    1.10  static int SW_RenderDrawLines(SDL_Renderer * renderer,
    1.11 @@ -125,6 +126,7 @@
    1.12      renderer->UpdateTexture = SW_UpdateTexture;
    1.13      renderer->LockTexture = SW_LockTexture;
    1.14      renderer->UnlockTexture = SW_UnlockTexture;
    1.15 +    renderer->SetClipRect = SW_SetClipRect;
    1.16      renderer->DestroyTexture = SW_DestroyTexture;
    1.17      renderer->RenderDrawPoints = SW_RenderDrawPoints;
    1.18      renderer->RenderDrawLines = SW_RenderDrawLines;
    1.19 @@ -266,6 +268,17 @@
    1.20  {
    1.21  }
    1.22  
    1.23 +static void
    1.24 +SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
    1.25 +{
    1.26 +    SDL_Surface *surface = SW_ActivateRenderer(renderer);
    1.27 +
    1.28 +    if (!surface) {
    1.29 +        return;
    1.30 +    }
    1.31 +    SDL_SetClipRect(surface, rect);
    1.32 +}
    1.33 +
    1.34  static int
    1.35  SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
    1.36                      int count)