comparison src/video/SDL_draw.h @ 3536:0267b8b1595c

Added interfaces for batch drawing of points, lines and rects: SDL_DrawPoints() SDL_BlendPoints() SDL_BlendLines() SDL_DrawLines() SDL_FillRects() SDL_BlendRects() SDL_RenderPoints() SDL_RenderLines() SDL_RenderRects() Renamed SDL_RenderFill() to SDL_RenderRect()
author Sam Lantinga <slouken@libsdl.org>
date Wed, 09 Dec 2009 15:56:56 +0000
parents 9f2482d6662c
children b931bcfd94a0
comparison
equal deleted inserted replaced
3535:b403f790df65 3536:0267b8b1595c
344 * Define blend fill macro 344 * Define blend fill macro
345 */ 345 */
346 346
347 #define FILLRECT(type, op) \ 347 #define FILLRECT(type, op) \
348 do { \ 348 do { \
349 int width = dstrect->w; \ 349 int width = rect->w; \
350 int height = dstrect->h; \ 350 int height = rect->h; \
351 int pitch = (dst->pitch / dst->format->BytesPerPixel); \ 351 int pitch = (dst->pitch / dst->format->BytesPerPixel); \
352 int skip = pitch - width; \ 352 int skip = pitch - width; \
353 type *pixel = (type *)dst->pixels + dstrect->y * pitch + dstrect->x; \ 353 type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \
354 while (height--) { \ 354 while (height--) { \
355 { int n = (width+3)/4; \ 355 { int n = (width+3)/4; \
356 switch (width & 3) { \ 356 switch (width & 3) { \
357 case 0: do { op; pixel++; \ 357 case 0: do { op; pixel++; \
358 case 3: op; pixel++; \ 358 case 3: op; pixel++; \