public void ReleaseDC(DxgiRect dirtyRect)
 {
     this.surface.ReleaseDC(ref dirtyRect);
 }
        public void Present(uint syncInterval, DxgiPresentOptions options, DxgiRect[] dirtyRects, DxgiRect scrollRect, DxgiPoint scrollOffset)
        {
            if (dirtyRects == null)
            {
                throw new ArgumentNullException("dirtyRects");
            }

            var dirtyRectsHandle   = GCHandle.Alloc(dirtyRects[0], GCHandleType.Pinned);
            var scrollRectHandle   = GCHandle.Alloc(scrollRect, GCHandleType.Pinned);
            var scrollOffsetHandle = GCHandle.Alloc(scrollOffset, GCHandleType.Pinned);

            DxgiPresentParameters parameters = new DxgiPresentParameters();

            parameters.DirtyRectsCount = (uint)dirtyRects.Length;
            parameters.DirtyRects      = dirtyRectsHandle.AddrOfPinnedObject();
            parameters.ScrollRect      = scrollRectHandle.AddrOfPinnedObject();
            parameters.ScrollOffset    = scrollOffsetHandle.AddrOfPinnedObject();

            this.swapChain.Present1(syncInterval, options, ref parameters);

            dirtyRectsHandle.Free();
            scrollRectHandle.Free();
            scrollOffsetHandle.Free();
        }