anchor.diff:                  if s.AllDifferent 0 then
                       transact (fun () -> size.Value <- s)
   
  +                    let buffer = render s 
                       img.Lock()
  -                    let buffer = render s 
                       img.SetBackBuffer(Interop.D3DResourceType.IDirect3DSurface9, buffer.Surface.NativePointer)
                       img.AddDirtyRect(Int32Rect(0, 0, img.PixelWidth, img.PixelHeight))
                       img.Unlock()
  
positive.code:         member x.Surface = dxSurface
  
          member x.Lock() =
              ()
  
          member x.Unlock() =
              use __ = ctx.Context.ResourceLock
              
              GL.Flush()
              GL.Finish()
              WGL.LockObjects(ctx.ShareDevice, [| shareHandle |])
  
              blit size renderBuffer resolveBuffer
  
              GL.Flush()
              GL.Finish()
              WGL.UnlockObjects(ctx.ShareDevice, [| shareHandle |])
              GL.Flush()
              GL.Finish()
  
          member x.Dispose() =
              if shareHandle.NotNull then
  
negative.code:                 failwith str
              ) fmt
  
          
  
          static let check() =
              lock l (fun () ->
                  if not supported then 
                      fail "WGL_NV_DX_interop is not supported"
  
                  if not loaded then
                      loaded <- true
                      match ContextHandle.Current with
                          | Some handle ->
                              wglDXSetResourceShareHandleNV <- handle.Import "wglDXSetResourceShareHandleNV"
                              wglDXOpenDeviceNV <- handle.Import "wglDXOpenDeviceNV"
                              wglDXCloseDeviceNV <- handle.Import "wglDXCloseDeviceNV"
                              wglDXRegisterObjectNV <- handle.Import "wglDXRegisterObjectNV"
                              wglDXUnregisterObjectNV <- handle.Import "wglDXUnregisterObjectNV"
                              wglDXObjectAccessNV <- handle.Import "wglDXObjectAccessNV"
                              wglDXLockObjectsNV <- handle.Import "wglDXLockObjectsNV"
                              wglDXUnlockObjectsNV <- handle.Import "wglDXUnlockObjectsNV"
                          | None ->
                              failwith "[WGL] cannot load WGL_NV_DX_interop without a context"
  
  
                  assert (Option.isSome ContextHandle.Current)
              )
  
          static member WGL_NV_DX_interop = supported
  
  