
  $ FileName "t.exe"
  'uses RTL32
  'uses RTL64
  string title="Move through scene using keyboard arrow keys (Ctrl to rotate   Shift to go fast )"
  % ExplicitMain
  uses OpenglSceneFrame
  uses glo2\shapes
  uses glo2\textures
  uses glo2\materials
  uses glo2\particles

  indexbase 1
  sys   GdiplusToken
  float ang1
  float ma[16]
  float li[16]
  sys   cube,sphere
  Cloud cloud1


  sub initialize(sys hWnd)
  ========================
  '
  GDIplus 1
  '
  static sys p,res=256
  BuildTextures 16,res
  '
  cube=CompileList   : CubeForm      : glEndList
  sphere=CompileList : Spheric 1,1,6 : glEndList
  '
  end sub

  sub Release(sys hwnd)
  '====================
  DeleteAllGlCompiled
  DeleteTextures  4
  Gdiplus         0
  end sub

  sub RenderCube(float x,y,z,sc,sys tex)
  ======================================
  glBindTexture GL_TEXTURE_2D,tex
  glPushMatrix
  gltranslatef x,y,z
  glscalef sc,sc,sc
  glCallList cube
  'glCallList pent
  glPopMatrix
  end sub

  sub RenderPlane(float x,y,z,sc,tex,u,v)
  =======================================
  glBindTexture GL_TEXTURE_2D,tex
  glPushMatrix
  gltranslatef x,y,z
  glscalef sc,1,sc
  glBegin GL_QUADS
  glTexCoord2f 0.0,0.0 : glVertex3f -1.0,0,-1.0
  glTexCoord2f u  ,0.0 : glVertex3f  1.0,0,-1.0
  glTexCoord2f u  ,v   : glVertex3f  1.0,0, 1.0
  glTexCoord2f 0.0,v   : glVertex3f -1.0,0, 1.0    
  glend
  glPopMatrix
  end sub


  sub scene(sys hWnd)
  '==================
  '
  static single ra,ri,angi1=.5
  sys t1=texn[10]
  sys t2=texn[11]
  '
  '
  DozyFrame
  glClearColor 0.5, 0.5, 0.7, 0.0
  Fog          0.5, 0.5, 0.7, 0.05 'rgb and density
  StandardLighting li
  StandardMaterial ma
  Navigation
  '
  'SPHERES
  glPushMatrix
  indexbase 1
  glTranslatef -20.,10.,-60.0
  glScalef      6.,6.,6.
  Material Red
  glCallList sphere
  glPopMatrix
  '
  glPushMatrix
  glTranslatef 2.5,-1.0,-6.0
  glScalef      .5,.5,.5
  Material White
  glCallList sphere
   glPopMatrix
  '
  glPushMatrix
  glTranslatef 2.5,-1.0,-12.0
  glScalef      .5,.5,.5
  Material RedShiny
  glCallList sphere
   glPopMatrix
  '
  glPushMatrix
  glTranslatef 2.5,-1.0,-18.0
  glScalef      .5,.5,.5
  Material GreenShiny
  glCallList sphere
   glPopMatrix
  '
  glPushMatrix
  glTranslatef 2.5,-1.0,-24.0
  glScalef      .5,.5,.5
  Material BlueShiny
  glCallList sphere
   glPopMatrix
  '
  Material White
  glEnable GL_TEXTURE_2D
  '
  RenderCube   2.5,-2.0,-6.0, 0.5,t1
  '
  RenderPlane  0.0,-2.0,-16.0,16.0,t2,8,8
  '
  glDisable GL_TEXTURE_2D
  glDisable GL_LIGHTING
  '
  'CLOUD
  glEnable GL_TEXTURE_2D
  glPushMatrix
  gltranslatef -10.0, -10.0, -48.0
  glscalef      20.0,12.0,1.0
  cloud1.render 30 'max 50
  glPopMatrix
  glDisable GL_TEXTURE_2D
  '
  ang1+=angi1
  if ang1>360 then ang1-=360
  sleep 10
  end sub

  MainWindow width,height,WS_OVERLAPPEDWINDOW
