pub(crate) fn new_simple() -> Result<D3D11Device, HRESULT> {
        let mut hr = 0;
        unsafe {
            let mut d3d11_device: *mut ID3D11Device = null_mut();
            // Note: could probably set single threaded in flags for small performance boost.
            let flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
            // Prefer hardware but use warp if it's the only driver available.
            for driver_type in &[D3D_DRIVER_TYPE_HARDWARE, D3D_DRIVER_TYPE_WARP] {
                hr = D3D11CreateDevice(
                    null_mut(),
                    *driver_type,
                    null_mut(),
                    flags,
                    null(),
                    0,
                    D3D11_SDK_VERSION,
                    &mut d3d11_device,
                    null_mut(),
                    null_mut(),
                );
                if SUCCEEDED(hr) {
                    break;
                }
            }
            if !SUCCEEDED(hr) {
                error!("D3D11CreateDevice: 0x{:x}", hr);
            }
            wrap(hr, d3d11_device, D3D11Device)
        }
    }
/// Creates a new device with basic defaults.
Creates a new device with basic defaults.
Creates a new device with basic defaults .
pub(crate) fn new_simple() -> Result<D3D11Device, HRESULT> {
        let mut hr = 0;
        unsafe {
            let mut d3d11_device: *mut ID3D11Device = null_mut();
            // Note: could probably set single threaded in flags for small performance boost.
            let flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
            // Prefer hardware but use warp if it's the only driver available.
            for driver_type in &[D3D_DRIVER_TYPE_HARDWARE, D3D_DRIVER_TYPE_WARP] {
                hr = D3D11CreateDevice(
                    null_mut(),
                    *driver_type,
                    null_mut(),
                    flags,
                    null(),
                    0,
                    D3D11_SDK_VERSION,
                    &mut d3d11_device,
                    null_mut(),
                    null_mut(),
                );
                if SUCCEEDED(hr) {
                    break;
                }
            }
            if !SUCCEEDED(hr) {
                error!("D3D11CreateDevice: 0x{:x}", hr);
            }
            wrap(hr, d3d11_device, D3D11Device)
        }
    }
pub ( crate ) fn new_simple ( ) -> Result < D3D11Device , HRESULT > { let mut hr = 0 ; unsafe { let mut d3d11_device : * mut ID3D11Device = null_mut ( ) ; // Note: could probably set single threaded in flags for small performance boost. let flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT ; // Prefer hardware but use warp if it's the only driver available. for driver_type in & [ D3D_DRIVER_TYPE_HARDWARE , D3D_DRIVER_TYPE_WARP ] { hr = D3D11CreateDevice ( null_mut ( ) , * driver_type , null_mut ( ) , flags , null ( ) , 0 , D3D11_SDK_VERSION , & mut d3d11_device , null_mut ( ) , null_mut ( ) , ) ; if SUCCEEDED ( hr ) { break ; } } if ! SUCCEEDED ( hr ) { error ! ( " " hr ) ; } wrap ( hr , d3d11_device , D3D11Device ) } }
Creates a new device with basic defaults.
Creates a new device with basic defaults .