5 #include "../gfxtools.h"
9 gfxline_t*mkstar(int x1, int y1, int x2, int y2)
11 gfxline_t*l=0,*line = 0;
13 for(x=x1;x<=x2;x+=50) {
14 l = malloc(sizeof(gfxline_t));
17 line = gfxline_append(line, l);
19 l = malloc(sizeof(gfxline_t));
21 l->x = x2-x;l->y = y2;
22 line = gfxline_append(line, l);
29 gfxline_t*box1 = gfxline_makerectangle(50,50,150,150);
31 // put box2 and box3 on top of each other *snicker*
32 gfxline_t*box2 = gfxline_makerectangle(100,100,200,200);
33 gfxline_t*box3 = gfxline_makerectangle(100,100,200,200);
34 gfxline_t*star = mkstar(50,50, 150,150);
36 b = gfxline_append(b, box1);
37 b = gfxline_append(b, box2);
38 b = gfxline_append(b, box3);
39 b = gfxline_append(b, star);
42 memset(&matrix, 0, sizeof(gfxmatrix_t));
44 matrix.m00=cos(ua);matrix.m10=sin(ua);
45 matrix.m01=-sin(ua);matrix.m11=cos(ua);
47 gfxline_transform(b, &matrix);
48 gfxpoly_t*poly = gfxpoly_fillToPoly(b);
54 gfxpoly_process(poly);
61 gfxline_t* line = malloc(sizeof(gfxline_t)*N);
63 line[t].type = t?gfx_lineTo:gfx_moveTo;
64 line[t].x = lrand48()%65536;
65 line[t].y = lrand48()%65536;
66 line[t].next = &line[t+1];
68 line[N-1].x = line[0].x;
69 line[N-1].y = line[0].y;
72 gfxpoly_t*poly = gfxpoly_fillToPoly(line);
74 gfxpoly_process(poly);