Пример #1
0
        public unsafe bool Init(DeviceDesc desc)
        {
            int nodeCount = 0;

            if (Orbital_Video_D3D12_Device_Init(handle, desc.adapterIndex, desc.softwareRasterizer ? 1 : 0, desc.allowMultiGPU ? 1 : 0, &nodeCount) == 0)
            {
                return(false);
            }
            this.nodeCount = nodeCount;
            if (type == DeviceType.Presentation)
            {
                swapChainD3D12 = new SwapChain(this, desc.ensureSwapChainMatchesWindowSize, desc.swapChainType);
                swapChain      = swapChainD3D12;
                if (desc.createDepthStencil)
                {
                    return(swapChainD3D12.Init(desc.window, desc.swapChainBufferCount, desc.fullscreen, desc.swapChainFormat, desc.stencilUsage, desc.depthStencilFormat, desc.depthStencilMode, desc.vSyncMode));
                }
                else
                {
                    return(swapChainD3D12.Init(desc.window, desc.swapChainBufferCount, desc.fullscreen, desc.swapChainFormat, desc.vSyncMode));
                }
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
 public bool Init(DeviceDesc desc)
 {
     window = desc.window;
     if (Orbital_Video_D3D12_Device_Init(handle, desc.adapterIndex, (desc.softwareRasterizer ? 1 : 0)) == 0)
     {
         return(false);
     }
     if (type == DeviceType.Presentation)
     {
         swapChain = new SwapChain(this, desc.ensureSwapChainMatchesWindowSize);
         return(swapChain.Init(desc.window, desc.swapChainBufferCount, desc.fullscreen));
     }
     else
     {
         return(true);
     }
 }