Mercurial > sdl-ios-xcode
comparison src/render/software/SDL_render_sw.c @ 5229:2178ffe17222
Added function SDL_RenderSetClipRect()
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 07 Feb 2011 20:06:26 -0800 |
parents | bb45ecd958d8 |
children | 710d00cb3a6a |
comparison
equal
deleted
inserted
replaced
5228:ab0d7cecc0f6 | 5229:2178ffe17222 |
---|---|
48 const SDL_Rect * rect, const void *pixels, | 48 const SDL_Rect * rect, const void *pixels, |
49 int pitch); | 49 int pitch); |
50 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, | 50 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, |
51 const SDL_Rect * rect, void **pixels, int *pitch); | 51 const SDL_Rect * rect, void **pixels, int *pitch); |
52 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); | 52 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); |
53 static void SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect); | |
53 static int SW_RenderDrawPoints(SDL_Renderer * renderer, | 54 static int SW_RenderDrawPoints(SDL_Renderer * renderer, |
54 const SDL_Point * points, int count); | 55 const SDL_Point * points, int count); |
55 static int SW_RenderDrawLines(SDL_Renderer * renderer, | 56 static int SW_RenderDrawLines(SDL_Renderer * renderer, |
56 const SDL_Point * points, int count); | 57 const SDL_Point * points, int count); |
57 static int SW_RenderFillRects(SDL_Renderer * renderer, | 58 static int SW_RenderFillRects(SDL_Renderer * renderer, |
123 renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; | 124 renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; |
124 renderer->SetTextureBlendMode = SW_SetTextureBlendMode; | 125 renderer->SetTextureBlendMode = SW_SetTextureBlendMode; |
125 renderer->UpdateTexture = SW_UpdateTexture; | 126 renderer->UpdateTexture = SW_UpdateTexture; |
126 renderer->LockTexture = SW_LockTexture; | 127 renderer->LockTexture = SW_LockTexture; |
127 renderer->UnlockTexture = SW_UnlockTexture; | 128 renderer->UnlockTexture = SW_UnlockTexture; |
129 renderer->SetClipRect = SW_SetClipRect; | |
128 renderer->DestroyTexture = SW_DestroyTexture; | 130 renderer->DestroyTexture = SW_DestroyTexture; |
129 renderer->RenderDrawPoints = SW_RenderDrawPoints; | 131 renderer->RenderDrawPoints = SW_RenderDrawPoints; |
130 renderer->RenderDrawLines = SW_RenderDrawLines; | 132 renderer->RenderDrawLines = SW_RenderDrawLines; |
131 renderer->RenderFillRects = SW_RenderFillRects; | 133 renderer->RenderFillRects = SW_RenderFillRects; |
132 renderer->RenderCopy = SW_RenderCopy; | 134 renderer->RenderCopy = SW_RenderCopy; |
264 static void | 266 static void |
265 SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) | 267 SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) |
266 { | 268 { |
267 } | 269 } |
268 | 270 |
271 static void | |
272 SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect) | |
273 { | |
274 SDL_Surface *surface = SW_ActivateRenderer(renderer); | |
275 | |
276 if (!surface) { | |
277 return; | |
278 } | |
279 SDL_SetClipRect(surface, rect); | |
280 } | |
281 | |
269 static int | 282 static int |
270 SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, | 283 SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, |
271 int count) | 284 int count) |
272 { | 285 { |
273 SDL_Surface *surface = SW_ActivateRenderer(renderer); | 286 SDL_Surface *surface = SW_ActivateRenderer(renderer); |