
  $ FileName "t.exe"
  'uses RTL64
  $ title "Fog"
  % ExplicitMain
  uses OpenglSceneFrame

  sub initialize(sys hWnd)
  ========================
  end sub


  sub Triangle
  ============
  glBegin GL_TRIANGLES
  glColor4f   1.0, 0.0, 0.0, 0.7 : glVertex3f   0.0,  1.0, 0.0
  glColor4f   0.0, 1.0, 0.0, 0.7 : glVertex3f  -1.0, -1.0, 0.0
  glColor4f   0.0, 0.0, 1.0, 0.7 : glVertex3f   1.0, -1.0, 0.0
  glEnd
  end sub

  sub scene(sys hWnd)
  '==================
  '
  static single s1,s2,s3,s4,ang1,angi1=1,ra,ri
  '
  fader(1,30,1) 'FADE IN
  fader(60,90,-1,CloseScene) 'FADE OUT

  ActiveFrame
  glClearColor 0.5, 0.5, 0.7, 0
  Fog          0.5, 0.5, 0.7, 0.1
  '
  glPushMatrix
  gltranslatef    6.0, 0.0, -16.0
  glrotatef    ang1,0,1,0
  Triangle
  glPopMatrix
  '
  glPushMatrix
  gltranslatef    2.0, 0.0, -8.0
  glrotatef    ang1,0,1,0
  Triangle
  glPopMatrix
  '
  glPushMatrix
  gltranslatef    0.0, 0.0, -4.0
  glrotatef    ang1,0,1,0
  Triangle
  glPopMatrix
  '
  ang1+=angi1
  if ang1>360 then ang1-=360
  end sub


  sub Release(sys hwnd)
  '====================
  end sub

  MainWindow 200,200  'first main window
  MainWindow 300,300  'second main window
  UnregisterMain()
