禁用图形卡后,为什么可以创建类型为D2D1_RENDER_TARGET_TYPE_HARDWARE的ID2D1HwndRenderTarget?

时间:2019-05-12 05:41:42

标签: direct2d

我在设备管理器中禁用了图形卡,然后运行了程序。返回的“ hr”为S_OK。

  • D2D1_RENDER_TARGET_TYPE_HARDWARE不是相应的图形卡吗?
  • 或者有什么方法可以知道ID2D1HwndRenderTarget是否正在使用图形卡?

...

D2D1_RENDER_TARGET_PROPERTIES props = 
    D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_HARDWARE, 
    D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED));
props.dpiX = (float)_dpi_x;
props.dpiY = (float)_dpi_y;
HRESULT hr = _pD2DFactory->CreateHwndRenderTarget(props, D2D1::HwndRenderTargetProperties(_hWnd, D2D1::SizeU((UINT32)(_width * _dpi_x / 96.0f), (UINT32)(_height * _dpi_y / 96.0f))), &_pRenderTarget);

ATLASSERT(SUCCEEDED(hr));

...

0 个答案:

没有答案