$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      INTEGER MAXX, MAXY
      INTEGER OLD_MODE
      INTEGER FG_AUTOMODE, FG_GETMAXX, FG_GETMAXY
      INTEGER FG_GETMODE, FG_MOUSEINI

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(FG_AUTOMODE())

      IF (FG_MOUSEINI() .LT. 0) THEN
         CALL FG_SETMODE(OLD_MODE)
         CALL FG_RESET
         STOP ' '
      END IF

      MAXX = FG_GETMAXX()
      MAXY = FG_GETMAXY()
      CALL FG_SETCOLOR(15)
      CALL FG_RECT(0,MAXX,0,MAXY)

      CALL FG_MOUSEVIS(1)
      CALL FG_MOUSELIM(MAXX/4,3*MAXX/4,MAXY/4,3*MAXY/4)
      CALL FG_WAITKEY

      CALL FG_MOUSEMOV(0,0)
      CALL FG_WAITFOR(36)
      CALL FG_MOUSEMOV(MAXX,0)
      CALL FG_WAITFOR(36)
      CALL FG_MOUSEMOV(MAXX,MAXY)
      CALL FG_WAITFOR(36)
      CALL FG_MOUSEMOV(0,MAXY)
      CALL FG_WAITFOR(36)
      CALL FG_MOUSEMOV(MAXX/2,MAXY/2)
      CALL FG_MOUSESPD(16,32)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
