anchor.diff:          let mutable openGlCtrl =  w.FindName("openGlCtrl") :?> SharpGL.WPF.OpenGLControl
           
           openGlCtrl.InitializeComponent()
  -        
  -        ref (openGlCtrl.OpenGL) := 
  -            Base.OpenGL 
  -                Version.OpenGLVersion.OpenGL3_1
  -                RenderContextType.FBO
  -                800 600 32
  -                (box [||])
  -        
  +        openGlCtrl.OpenGL.Create(Version.OpenGLVersion.OpenGL3_1, RenderContextType.FBO, 800, 600, 32, (box [||]))
  +        |> printfn "openGlCtrl.OpenGL.Create %b"
  +
           openGlCtrl.OpenGLVersion <- Version.OpenGLVersion.OpenGL3_1
  -        
  -        [| 
  -            fun _ -> ()
  -            fun _ -> Init (openGlCtrl.OpenGL)                          
  -            fun _ -> openGlCtrl.OpenGLDraw.Add (fun x -> Display (x.OpenGL)) 
  -            fun _ -> openGlCtrl.OpenGLInitialized.Add (fun x ->  ())         
  -            fun _ -> openGlCtrl.RenderContextType <- RenderContextType.FBO
  -            fun _ -> openGlCtrl.Resized.Add (fun _ -> ())                    
  -            fun _ -> openGlCtrl.Visibility <- Visibility.Visible            
  -        |]
  -        |> Array.iteri (fun i f -> f (); printfn "%d" i)
  +        Arrange (ref openGlCtrl.OpenGL)
  +
  +        openGlCtrl.DrawFPS <- true
  +        //openGlCtrl.Foreground <- Media.Brushes.White
  +        openGlCtrl.OpenGLDraw.Add (fun x -> Display (ref x.OpenGL))
  +//        openGlCtrl.Resized.Add (fun x -> Display (ref x.OpenGL))
  +
  +//        [| 
  +//            fun _ -> () 
  +//            fun _ -> openGlCtrl.OpenGLDraw.Add (fun x -> Display (ref x.OpenGL)) 
  +//            fun _ -> openGlCtrl.OpenGLInitialized.Add (fun x -> Display (ref x.OpenGL))         
  +//            fun _ -> openGlCtrl.RenderContextType <- RenderContextType.FBO
  +//            fun _ -> openGlCtrl.Resized.Add (fun x -> Display (ref x.OpenGL))                    
  +//            fun _ -> openGlCtrl.Visibility <- Visibility.Visible            
  +//        |]
  +//        |> Array.iteri (fun i f -> f (); printfn "%d" i)
   
           w.Title <- sprintf "%s - OpenGL %A" w.Title openGlCtrl.OpenGLVersion
           w
  
positive.code:         use reader = new StreamReader(stream)
          reader.ReadToEnd()
  
      /// Loads the shader sourcecode from the text file.
      let LoadTextFile (textFileName : string) = 
          if Regex(@"^(([a-zA-Z]:\\)|([a-zA-Z]://)|(//)).*").IsMatch(textFileName) then
              File.ReadAllText(textFileName)
          else
              File.ReadAllText(Path.Combine(__SOURCE_DIRECTORY__, textFileName))
  
  
      let OpenGL (openGLVersion : Version.OpenGLVersion) 
                  (renderContextType : RenderContextType)
                  width height bitDepth 
                  (parameters : obj) =
          let gl = OpenGL()
          if not (gl.Create(openGLVersion, 
                            renderContextType, 
                            width, height, 32, 
                            parameters)) then
              failwith (sprintf "Base.glCreate SharpGL.Version.OpenGLVersion %A" openGLVersion)       
          gl
  
  
  
  
  
  
  
  
  module Main = 
  
  
      // https://github.com/mattdesl/lwjgl-basics/wiki/GLSL-Versions
      let vertexShaderCode =
          """
  #version 140
  
negative.code: open GlmNet
  
  
  /// F# convenience wrapper for SharpGL
  type Base =
      
      /// Load the shader sourcecode from the named manifest resource.
      static member LoadManifestResource (textFileName : string) =
          let executingAssembly = Assembly.GetExecutingAssembly()
          let pathToDots = textFileName.Replace("\\", ".")
          let location = String.Format("{0}.{1}", executingAssembly.GetName().Name, pathToDots)
  