Ejemplo n.º 1
0
 public void Resize(Size size)
 {
     this.CheckDisposed();
     this.Size = GetValidatedSize(ref size);
     try
     {
         this.DisconnectLinkedResources();
         this.DisconnectRenderTargetView();
         DisposableHelpers.DisposeAndSetNull(ref this.m_renderTargetView);
         // Resize retaining other properties.
         this.SwapChain1?.ResizeBuffers(0, this.Size.Width, this.Size.Height, Format.Unknown, SwapChainFlags.None);
         this.ConnectRenderTargetView();
         this.ConnectLinkedResources();
     }
     catch (SharpDXException ex)
     {
         if (ErrorHelpers.ShouldResetDxgiForError(ex.Descriptor))
         {
             this.Destroy();
         }
         else
         {
             throw;
         }
     }
 }
Ejemplo n.º 2
0
 public bool PerformResetOnException(SharpDXException ex)
 {
     if (ErrorHelpers.ShouldResetDxgiForError(ex.Descriptor))
     {
         this.m_d3D?.Destroy();
         return(true);
     }
     return(false);
 }