mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Examples: DirectX10, DirectX11: try WARP software driver if hardware driver is not available. (#5924, #5562)
This commit is contained in:
parent
4b39c1f654
commit
9c1dac3ff0
3 changed files with 9 additions and 2 deletions
|
|
@ -182,7 +182,10 @@ bool CreateDeviceD3D(HWND hWnd)
|
|||
|
||||
UINT createDeviceFlags = 0;
|
||||
//createDeviceFlags |= D3D10_CREATE_DEVICE_DEBUG;
|
||||
if (D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice) != S_OK)
|
||||
HRESULT res = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice);
|
||||
if (res == DXGI_ERROR_UNSUPPORTED) // Try high-performance WARP software driver if hardware is not available.
|
||||
res = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_WARP, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice);
|
||||
if (res != S_OK)
|
||||
return false;
|
||||
|
||||
CreateRenderTarget();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue