home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / LATTIC_3.LZH / EXAMPLES / POLY.C < prev    next >
C/C++ Source or Header  |  1990-05-14  |  1KB  |  57 lines

  1. /*
  2.  * Demonstrate the Line-A polygon primitive
  3.  *
  4.  * lc -L poly.c
  5.  *
  6.  * Copyright (c) 1990 HiSoft
  7.  */
  8.  
  9. #include <linea.h>
  10.  
  11. int main(void)
  12. {
  13.     short pts[]={160,100,0,50,80,199,319,199,319,50,160,100};
  14.     short contrl[2];
  15.     short pattern[]=
  16.     {
  17.         0x0940,        /* %0000 1001 0100 0000 */
  18.         0x0940,        /* %0000 1001 0100 0000 */
  19.         0x0f40,        /* %0000 1111 0100 0000 */
  20.         0x0940,        /* %0000 1001 0100 0000 */
  21.         0x0940,        /* %0000 1001 0100 0000 */
  22.         0x0000,        /* %0000 0000 0000 0000 */
  23.         0x64dc,        /* %0110 0100 1101 1100 */
  24.         0x8a88,        /* %1000 1010 1000 1000 */
  25.         0xcac8,        /* %1100 1010 1100 1000 */
  26.         0x2a88,        /* %0010 1010 1000 1000 */
  27.         0xa488,        /* %1100 0100 1000 1000 */
  28.         0x0000,        /* %0000 0000 0000 0000 */
  29.         0x0000,        /* %0000 0000 0000 0000 */
  30.         0x0000,        /* %0000 0000 0000 0000 */
  31.         0x0000,        /* %0000 0000 0000 0000 */
  32.         0x0000,        /* %0000 0000 0000 0000 */
  33.     };
  34.     register int i;
  35.     
  36.     linea0();
  37.     PTSIN=&pts;
  38.     CONTRL=&contrl;
  39.     contrl[1]=sizeof(pts)/(sizeof(short)*2)-1;
  40.     COLBIT0=1;
  41.     COLBIT1=1;
  42.     COLBIT2=1;
  43.     COLBIT3=1;
  44.     WMODE=0;
  45.     PATPTR=&pattern;
  46.     PATMSK=sizeof(pattern)/sizeof(short)-1;
  47.     MFILL=0;
  48.     CLIP=0;
  49.  
  50.     Y1=0;
  51.     for (i=0; i<200; i++)
  52.     {
  53.         Y1++;
  54.         linea6();
  55.     }
  56. }
  57.