home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / contrib / libgrx / src / pattpoly.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-06  |  2.2 KB  |  78 lines

  1. /**
  2.  ** CUSTLINE.H
  3.  **
  4.  **  Copyright (C) 1992, Csaba Biegl
  5.  **    820 Stirrup Dr, Nashville, TN, 37221
  6.  **    csaba@vuse.vanderbilt.edu
  7.  **
  8.  **  This file is distributed under the terms listed in the document
  9.  **  "copying.cb", available from the author at the address above.
  10.  **  A copy of "copying.cb" should accompany this file; if not, a copy
  11.  **  should be available from where this file was obtained.  This file
  12.  **  may not be distributed without a verbatim copy of "copying.cb".
  13.  **  You should also have received a copy of the GNU General Public
  14.  **  License along with this program (it is in the file "copying");
  15.  **  if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  16.  **  Cambridge, MA 02139, USA.
  17.  **
  18.  **  This program is distributed in the hope that it will be useful,
  19.  **  but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.  **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.  **  GNU General Public License for more details.
  22.  **/
  23.  
  24. #include "grx.h"
  25. #include "libgrx.h"
  26. #include "thicklne.h"
  27.  
  28. void GrPatternedPolyLine(int numpts,int points[][2],GrLinePattern *lp)
  29. {
  30.     GrCustomLineData args;
  31.  
  32.     _GrBuildCustomLineData(lp->lnp_option,&args);
  33.     _GrSetupPatternedDraw(lp->lnp_pattern,&args);
  34.     _GrDrawPolygon(numpts,points,
  35.         FALSE,
  36.         TRUE,
  37.         _GrDoCustomCorner,
  38.         _GrDoCustomSegment,
  39.         &args
  40.     );
  41. }
  42.  
  43. void GrPatternedPolygon(int numpts,int points[][2],GrLinePattern *lp)
  44. {
  45.     GrCustomLineData args;
  46.  
  47.     _GrBuildCustomLineData(lp->lnp_option,&args);
  48.     _GrSetupPatternedDraw(lp->lnp_pattern,&args);
  49.     _GrDrawPolygon(numpts,points,
  50.         TRUE,
  51.         TRUE,
  52.         _GrDoCustomCorner,
  53.         _GrDoCustomSegment,
  54.         &args
  55.     );
  56. }
  57.  
  58. void GrPatternedBox(int x1,int y1,int x2,int y2,GrLinePattern *lp)
  59. {
  60.     GrCustomLineData args;
  61.     int points[4][2];
  62.  
  63.     points[0][0] = x1; points[0][1] = y1;
  64.     points[1][0] = x1; points[1][1] = y2;
  65.     points[2][0] = x2; points[2][1] = y2;
  66.     points[3][0] = x2; points[3][1] = y1;
  67.     _GrBuildCustomLineData(lp->lnp_option,&args);
  68.     _GrSetupPatternedDraw(lp->lnp_pattern,&args);
  69.     _GrDrawPolygon(4,points,
  70.         TRUE,
  71.         TRUE,
  72.         _GrDoCustomCorner,
  73.         _GrDoCustomSegment,
  74.         &args
  75.     );
  76. }
  77.  
  78.