$INCLUDE: 'C:\FG\INTRFACE.FOR'

      PROGRAM MAIN

      PARAMETER (NVERTICES=10)

      INTEGER*2 OLD_MODE
      INTEGER*2 FG_GETMODE, FG_TESTMODE
      INTEGER*2 XY(NVERTICES*2)
      INTEGER*2 WORK_ARRAY(700)

      DATA XY /200,100, 300, 80, 400,100, 400,220, 300,320,
     +         240,320, 160,240, 160,200, 200,160, 210,150/

      OLD_MODE = FG_GETMODE()

      IF (FG_TESTMODE(16,1) .EQ. 1) THEN
         CALL FG_SETMODE(16)
      ELSE IF (FG_TESTMODE(15,1) .EQ. 1) THEN
         CALL FG_SETMODE(15)
      ELSE
         STOP 'This program requires a 640 x 350 EGA graphics mode.'
      END IF

      CALL FG_SETCOLOR(1)
      CALL FG_POLYOFF(-120,-25)
      CALL FG_POLYLINE(XY,NVERTICES)
      CALL FG_POLYOFF(200,-25)
      CALL FG_POLYFILL(XY,WORK_ARRAY,NVERTICES)
      CALL FG_WAITKEY

      CALL FG_SETCOLOR(2)
      CALL FG_SETCLIP(480,639,175,349)
      CALL FG_POLYFILL(XY,WORK_ARRAY,NVERTICES)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
