Ejemplo n.º 1
0
        public static SwapChain1 CreateSwapChain1(D3D11MetaResourceOptions creationOpts, D3D11MetaResource resource)
        {
            creationOpts.SwapChainDescription.Width  = resource.Size.Width;
            creationOpts.SwapChainDescription.Height = resource.Size.Height;

            switch (creationOpts.Target)
            {
            case SwapChainTarget.Composition:
                return(new SwapChain1(resource.DxgiFactory2, resource.Device1, ref creationOpts.SwapChainDescription));

            case SwapChainTarget.Window:
                return(new SwapChain1(resource.DxgiFactory2, resource.Device1, resource.Hwnd,
                                      ref creationOpts.SwapChainDescription));

            case SwapChainTarget.CoreWindow:
                using (var comObject = new ComObject(resource.Hwnd))
                {
                    return(new SwapChain1(resource.DxgiFactory2, resource.Device1, comObject,
                                          ref creationOpts.SwapChainDescription));
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
 public D3D11MetaResource(D3D11MetaResourceOptions creationOpts)
 {
     this.m_creationOpts = creationOpts;
 }