Main

'' Open graphics window with specified coordinates,
'' and a title
''--------------------------------------------------
   
   Define WINDOW.ID as integer variable

   call OPENWINDOW.R given 4096, 28672, 0 , 32767,
                          " Eagle",
                          0
                          yielding WINDOW.ID

   call SETWINDOW.R given WINDOW.ID


'' Set world view and view port


   Let VXFORM.V =1
   call SETWORLD.R ( -16767.0, 16767.0, -16767.0, 16767.0)

'' Display icons from f15.sg2 library
  
   call read.glib.r ("f15.sg2")

   show BACKGROUND with "Background.icn"   at (0.0 , 0.0)

''   show WEATHER with "weather.icn"    at (0.0 , 0.0)

'' Forms definitions:
     Define FORM.PTR as a pointer variable

'' Presentation graphics:
     Let TIMESYNC.V = 'CLOCK'
     show CLOCK.TIME with "clock.grf" at ( 4746.00, 27623.00)

'' Display the form and get model parameters
     Show FORM.PTR with "image.frm"
     If ACCEPT.F(FORM.PTR, 0) eq "OK"

         '' Set timescale and speed:
         '' timescale is the number of 1/100ths seconds 
         '' that will pass for every simulation time unit. 
         '' The speed is in real world units / second.

         Let TIMESCALE.V = DDVAL.A(DFIELD.F("TIMESCALE", FORM.PTR))
         Let SPEED = DDVAL.A(DFIELD.F("SPEED", FORM.PTR))
         Let NUM.ROTATIONS = DDVAL.A(DFIELD.F("NUM ROTATIONS", FORM.PTR))

         

         '' Accept icon name for graphics entity IMAGE,
         '' show it with that name and   
         '' activate an 'image.motion' process.

          Activate an IMAGE.MOTION now
          Show IMAGE with DTVAL.A(DFIELD.F("ICON NAME", FORM.PTR)) 
                                at ( -10000.0,-4000.0) 
        
          Start simulation

     Always
End''Main
