Exemplo n.º 1
0
 public static void HandlePaintD2DClipped(EventedWindowCore window, Dx11Component resource,
                                          Action <DeviceContext> handler, ref RawRectangleF clip, RawColor4?clearColorBeforeClip = null)
 {
     resource.EnsureInitialized();
     try
     {
         var context = resource.D2D.Context;
         context.BeginDraw();
         if (clearColorBeforeClip.HasValue)
         {
             context.Clear(clearColorBeforeClip.Value);
         }
         context.PushAxisAlignedClip(clip,
                                     AntialiasMode.Aliased);
         handler(context);
         context.PopAxisAlignedClip();
         context.EndDraw();
         resource.D3D.SwapChain.Present(1, 0);
         window.Validate();
     }
     catch (SharpDXException ex)
     {
         if (!resource.PerformResetOnException(ex))
         {
             throw;
         }
     }
 }
Exemplo n.º 2
0
 public static void HandlePaint(EventedWindowCore window, Dx11Component resource,
                                Action <Dx11Component> handler)
 {
     resource.EnsureInitialized();
     try
     {
         handler(resource);
         resource.D3D.SwapChain.Present(1, 0);
         window.Validate();
     }
     catch (SharpDXException ex)
     {
         if (!resource.PerformResetOnException(ex))
         {
             throw;
         }
     }
 }
Exemplo n.º 3
0
 public static void HandlePaintD2D(EventedWindowCore window, Dx11Component resource,
                                   Action <DeviceContext> handler)
 {
     resource.EnsureInitialized();
     try
     {
         var context = resource.D2D.Context;
         context.BeginDraw();
         handler(context);
         context.EndDraw();
         resource.D3D.SwapChain.Present(1, 0);
         window.Validate();
     }
     catch (SharpDXException ex)
     {
         if (!resource.PerformResetOnException(ex))
         {
             throw;
         }
     }
 }