예제 #1
0
        public static D3d.Device CreateDevice(   Settings deviceSettings,
            System.Windows.Forms.Control renderWindow)
        {
            EnumerateAdapters();

            // First try full hardware acceleration.
            D3d.PresentParameters   presentParams   = deviceSettings.GetPresentParameters( renderWindow );
            D3d.CreateFlags         createFlags     = deviceSettings.GetCreateFlags(true,true);

            D3d.Device d3dDevice = CreateDevice( renderWindow,presentParams,createFlags,deviceSettings );

            if (d3dDevice == null)
            {
                log.Warning("Pure device not available.");
                createFlags = deviceSettings.GetCreateFlags(false,true);

                d3dDevice = CreateDevice( renderWindow,presentParams,createFlags,deviceSettings );

                if (d3dDevice == null)
                {
                    log.Warning("Hardware vertex processing not available.");
                    createFlags = deviceSettings.GetCreateFlags( false,false );

                    d3dDevice = CreateDevice( renderWindow,presentParams,createFlags,deviceSettings );
                }
            }

            return d3dDevice;
        }
예제 #2
0
        public static D3d.Device    CreateDevice(Settings deviceSettings,
                                                 System.Windows.Forms.Control renderWindow)
        {
            EnumerateAdapters();

            // First try full hardware acceleration.
            D3d.PresentParameters presentParams = deviceSettings.GetPresentParameters(renderWindow);
            D3d.CreateFlags       createFlags   = deviceSettings.GetCreateFlags(true, true);

            D3d.Device d3dDevice = CreateDevice(renderWindow, presentParams, createFlags, deviceSettings);

            if (d3dDevice == null)
            {
                log.Warning("Pure device not available.");
                createFlags = deviceSettings.GetCreateFlags(false, true);

                d3dDevice = CreateDevice(renderWindow, presentParams, createFlags, deviceSettings);

                if (d3dDevice == null)
                {
                    log.Warning("Hardware vertex processing not available.");
                    createFlags = deviceSettings.GetCreateFlags(false, false);

                    d3dDevice = CreateDevice(renderWindow, presentParams, createFlags, deviceSettings);
                }
            }

            return(d3dDevice);
        }
예제 #3
0
 public static FrameBuffer Create(Settings settings, D3d.Device device, System.Windows.Forms.Control renderWindow)
 {
     D3d.SwapChain swapChain = new D3d.SwapChain( device,settings.GetPresentParameters(renderWindow) );
     return null;
 }
예제 #4
0
 public static FrameBuffer Create(Settings settings, D3d.Device device, System.Windows.Forms.Control renderWindow)
 {
     D3d.SwapChain swapChain = new D3d.SwapChain(device, settings.GetPresentParameters(renderWindow));
     return(null);
 }