/// <summary> /// Creates an <see cref="ID2D1Device"/> instance. /// </summary> /// <param name="d2D1Factory2">The input <see cref="ID2D1Factory2"/> instance to use to create the device.</param> /// <returns>A new <see cref="ID2D1Device"/> instance.</returns> public static unsafe ComPtr <ID2D1Device> CreateD2D1Device(ID2D1Factory2 *d2D1Factory2) { using ComPtr <ID3D11Device> d3D11Device = default; uint creationFlags = (uint)D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT; D3D_FEATURE_LEVEL *featureLevels = stackalloc[] { D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_9_1 }; D3D_FEATURE_LEVEL d3DFeatureLevel; // Create the Direct3D 11 API device and context DirectX.D3D11CreateDevice( pAdapter: null, DriverType: D3D_DRIVER_TYPE.D3D_DRIVER_TYPE_HARDWARE, Software: HMODULE.NULL, Flags: creationFlags, pFeatureLevels: featureLevels, FeatureLevels: 7, SDKVersion: D3D11.D3D11_SDK_VERSION, ppDevice: d3D11Device.GetAddressOf(), pFeatureLevel: &d3DFeatureLevel, ppImmediateContext: null).Assert(); using ComPtr <IDXGIDevice3> dxgiDevice3 = default; // Get a DXGI device from the D3D11 device d3D11Device.CopyTo(dxgiDevice3.GetAddressOf()).Assert(); using ComPtr <ID2D1Device> d2D1Device = default; // Create a D2D1 device d2D1Factory2->CreateDevice( dxgiDevice: (IDXGIDevice *)dxgiDevice3.Get(), d2dDevice: d2D1Device.GetAddressOf()); return(d2D1Device.Move()); }
public int GetMinFeatureLevel([NativeTypeName("enum D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pLevel) { return(((delegate * unmanaged <ID3D12ShaderReflection *, D3D_FEATURE_LEVEL *, int>)(lpVtbl[19]))((ID3D12ShaderReflection *)Unsafe.AsPointer(ref this), pLevel)); }
public int CreateDeviceContextState([NativeTypeName("UINT")] uint Flags, [NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pFeatureLevels, [NativeTypeName("UINT")] uint FeatureLevels, [NativeTypeName("UINT")] uint SDKVersion, [NativeTypeName("const IID &")] Guid *EmulatedInterface, [NativeTypeName("D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pChosenFeatureLevel, [NativeTypeName("ID3DDeviceContextState **")] ID3DDeviceContextState **ppContextState) { return(((delegate * unmanaged <ID3D11Device1 *, uint, D3D_FEATURE_LEVEL *, uint, uint, Guid *, D3D_FEATURE_LEVEL *, ID3DDeviceContextState **, int>)(lpVtbl[47]))((ID3D11Device1 *)Unsafe.AsPointer(ref this), Flags, pFeatureLevels, FeatureLevels, SDKVersion, EmulatedInterface, pChosenFeatureLevel, ppContextState)); }
public HRESULT GetMaximumSupportedFeatureLevel([NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *featureLevels, [NativeTypeName("UINT32")] uint featureLevelsCount, D3D_FEATURE_LEVEL *maximumSupportedFeatureLevel) { return(((delegate * unmanaged <ID2D1EffectContext2 *, D3D_FEATURE_LEVEL *, uint, D3D_FEATURE_LEVEL *, int>)(lpVtbl[5]))((ID2D1EffectContext2 *)Unsafe.AsPointer(ref this), featureLevels, featureLevelsCount, maximumSupportedFeatureLevel)); }
public static extern int D3D11On12CreateDevice([NativeTypeName("IUnknown *")] IUnknown *pDevice, [NativeTypeName("UINT")] uint Flags, [NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pFeatureLevels, [NativeTypeName("UINT")] uint FeatureLevels, [NativeTypeName("IUnknown *const *")] IUnknown **ppCommandQueues, [NativeTypeName("UINT")] uint NumQueues, [NativeTypeName("UINT")] uint NodeMask, [NativeTypeName("ID3D11Device **")] ID3D11Device **ppDevice, [NativeTypeName("ID3D11DeviceContext **")] ID3D11DeviceContext **ppImmediateContext, [NativeTypeName("D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pChosenFeatureLevel);
public static extern HRESULT D3D11CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, [NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pFeatureLevels, uint FeatureLevels, uint SDKVersion, [NativeTypeName("const DXGI_SWAP_CHAIN_DESC *")] DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, ID3D11DeviceContext **ppImmediateContext);
public static extern HRESULT D3D11CreateDevice(IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, uint Flags, [NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL *pFeatureLevels, uint FeatureLevels, uint SDKVersion, ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, ID3D11DeviceContext **ppImmediateContext);