let init_display () =
  Glut.initDisplayMode ~double_buffer:true ~depth:true ();
  Glut.initWindowSize 500 500;
  ignore (Glut.createWindow "Skeg - Sex, Kinematics, Elegance and Glory");

  GlClear.color (0., 0., 0.);
  shade_model `smooth ;
  GlLight.light_model (`two_side true) ;
  GlLight.light 0 (`ambient (0.5,0.,0.,1.)) ;
  GlLight.light 0 (`diffuse (0.,0.7,0.,1.)) ;
  GlLight.light 0 (`specular (0.,0.,0.7,1.)) ;

  List.iter Gl.enable
    [`depth_test;`lighting;`light0;`normalize] ;

  Glut.specialFunc on_key ;
  Glut.keyboardFunc on_kbd ;
  Glut.displayFunc display ;
  if not !walk then Glut.mouseFunc on_mouse ;
  Glut.reshapeFunc (fun ~w:x ~h:y -> Glut.postRedisplay ()) ;

  GlMat.mode `projection ;
  GlMat.load_identity () ;
  GluMat.perspective ~fovy:80. ~aspect:1. ~z:(0.1,100.);

  Visu.set_step_mb !grid_step