comparison src/video/SDL_draw.h @ 2901:133601e3b255

Added RenderPiont() API Merged the drawing tests into a single test program
author Sam Lantinga <slouken@libsdl.org>
date Sun, 21 Dec 2008 17:39:41 +0000
parents 3a9636c83849
children e426c4fc9cf7
comparison
equal deleted inserted replaced
2900:3a9636c83849 2901:133601e3b255
26 /* This code assumes that r, g, b, a are the source color, 26 /* This code assumes that r, g, b, a are the source color,
27 * and in the blend and add case, the RGB values are premultiplied by a. 27 * and in the blend and add case, the RGB values are premultiplied by a.
28 */ 28 */
29 29
30 #define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255) 30 #define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255)
31
32 #define DRAW_FASTSETPIXEL(x, y, type, bpp, color) \
33 *(type *)(dst->pixels + y * dst->pitch + x * bpp) = (type) color
34
35 #define DRAW_FASTSETPIXEL1(x, y) DRAW_FASTSETPIXEL(x, y, Uint8, 1, color);
36 #define DRAW_FASTSETPIXEL2(x, y) DRAW_FASTSETPIXEL(x, y, Uint16, 2, color);
37 #define DRAW_FASTSETPIXEL4(x, y) DRAW_FASTSETPIXEL(x, y, Uint32, 4, color);
31 38
32 #define DRAW_SETPIXEL(setpixel) \ 39 #define DRAW_SETPIXEL(setpixel) \
33 do { \ 40 do { \
34 unsigned sr = r, sg = g, sb = b, sa = a; \ 41 unsigned sr = r, sg = g, sb = b, sa = a; \
35 setpixel; \ 42 setpixel; \