home *** CD-ROM | disk | FTP | other *** search
/ MegaDoom Adventures / PMWMEGADOOM.iso / doom / creators / deu52gcc / src / contrib / bcc2grx / test / tpoly.c < prev    next >
C/C++ Source or Header  |  1993-06-03  |  1KB  |  50 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #ifdef __GNUC__
  4. #  include <libbcc.h>
  5. #  include <pc.h>
  6. #  define getch() getkey()
  7. #else
  8. #  include <graphics.h>
  9. #  include <conio.h>
  10. #endif
  11.  
  12. void main(void)
  13. {
  14.   int gd, gm;
  15.   int err;
  16.   int poly[50];
  17.  
  18.   gd = DETECT;
  19.   initgraph(&gd,&gm,"c:\\bc\\bgi");
  20.   err = graphresult();
  21.   if (err != grOk) {
  22.     fprintf(stderr, "Couldn't initialize graphics\n");
  23.     exit(1);
  24.   }
  25.   setfillstyle( SOLID_FILL, GREEN);
  26.   poly[ 0] =  10;          poly[ 1] =  10;
  27.   poly[ 2] =  20;          poly[ 3] =  20;
  28.   poly[ 4] =  20;          poly[ 5] = getmaxy()-20;
  29.   poly[ 6] = getmaxx()-20; poly[ 7] = getmaxy()-20;
  30.   poly[ 8] = getmaxx()-20; poly[ 9] =  20;
  31.   poly[10] =  20;          poly[11] =  20;
  32.   poly[12] =  75;          poly[13] =  35;
  33.   poly[14] =  75;          poly[15] = getmaxy()-50;
  34.   poly[16] = getmaxx()-60; poly[17] = getmaxy()-50;
  35.   poly[18] = getmaxx()-60; poly[19] =  35;
  36.   poly[20] =  75;          poly[21] =  35;
  37.   drawpoly( 11, poly);
  38.   getch();
  39.   cleardevice();
  40.   fillpoly( 11, poly);
  41.   getch();
  42.   cleardevice();
  43.   drawpoly( 10, &poly[2]);
  44.   getch();
  45.   cleardevice();
  46.   fillpoly( 10, &poly[2]);
  47.   getch();
  48.   closegraph();
  49. }
  50.