1 /**
2 ** pattpoly.c
3 **
4 ** Copyright (C) 1997, Michael Goffioul
5 ** [e-mail : goffioul@emic.ucl.ac.be]
6 **
7 ** Copyright (c) 1995 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
8 ** [e-mail: csaba@vuse.vanderbilt.edu]
9 **
10 ** Copyright (C) 1992, Csaba Biegl
11 ** 820 Stirrup Dr, Nashville, TN, 37221
12 ** csaba@vuse.vanderbilt.edu
13 **
14 ** This file is part of the GRX graphics library.
15 **
16 ** The GRX graphics library is free software; you can redistribute it
17 ** and/or modify it under some conditions; see the "copying.grx" file
18 ** for details.
19 **
20 ** This library is distributed in the hope that it will be useful,
21 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 **
24 **/
25
26 #include "libgrx.h"
27 #include "shapes.h"
28
GrPatternedPolyLine(int numpts,int points[][2],GrLinePattern * lp)29 void GrPatternedPolyLine(int numpts,int points[][2],GrLinePattern *lp)
30 {
31 GrFillArg fval;
32
33 fval.p = lp->lnp_pattern;
34 _GrDrawCustomPolygon(numpts,points,lp->lnp_option,
35 &_GrPatternFiller,fval,FALSE,FALSE);
36 }
37
GrPatternedPolygon(int numpts,int points[][2],GrLinePattern * lp)38 void GrPatternedPolygon(int numpts,int points[][2],GrLinePattern *lp)
39 {
40 GrFillArg fval;
41
42 fval.p = lp->lnp_pattern;
43 _GrDrawCustomPolygon(numpts,points,lp->lnp_option,
44 &_GrPatternFiller,fval,TRUE,FALSE);
45 }
46
GrPatternedBox(int x1,int y1,int x2,int y2,GrLinePattern * lp)47 void GrPatternedBox(int x1,int y1,int x2,int y2,GrLinePattern *lp)
48 {
49 GrFillArg fval;
50 int points[4][2];
51
52 points[0][0] = x1; points[0][1] = y1;
53 points[1][0] = x1; points[1][1] = y2;
54 points[2][0] = x2; points[2][1] = y2;
55 points[3][0] = x2; points[3][1] = y1;
56 fval.p = lp->lnp_pattern;
57 _GrDrawCustomPolygon(4,points,lp->lnp_option,
58 &_GrPatternFiller,fval,TRUE,FALSE);
59 }
60