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

      PROGRAM MAIN

      INTEGER NEW_MODE, OLD_MODE
      INTEGER FG_BESTMODE, FG_GETMODE, FG_MAPRGB

      CALL FG_INITPM
      NEW_MODE = FG_BESTMODE(320,200,1)
      IF (NEW_MODE.LT.0 .OR. NEW_MODE.EQ.4 .OR. NEW_MODE.EQ.12) THEN
         WRITE(6,*) 'This program requires a 320 x 200'
         STOP '16-color or 256-color graphics mode.'
      END IF
      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(NEW_MODE)

      CALL FG_SETCOLOR(1)
      IF (NEW_MODE .LE. 16) THEN
         CALL FG_PALETTE(1,FG_MAPRGB(45,49,63))
      ELSE
         CALL FG_SETRGB(1,45,49,63)
      END IF
      CALL FG_TEXT('Hello',5)
      CALL FG_WAITKEY()

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
