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

      PROGRAM MAIN

      PARAMETER (NVERTICES=10)

      INTEGER*2 OLD_MODE
      INTEGER*2 FG_GETMODE, FG_TESTMODE
      INTEGER*2 X(NVERTICES), Y(NVERTICES)

      DATA X /200,300,400,400,300,240,160,160,200,210/
      DATA Y /100, 80,100,220,320,320,240,200,160,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_POLYGON(X,Y,NVERTICES)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
