本教程是否有在任何地方使用 ID2D1Device3 的版本?只是换掉所有指针类型似乎不起作用
https://docs.microsoft.com/en-us/windows/win32/direct2d/direct2d-quickstart-with-device-context?redirectedfrom=MSDN 由于参数列表不匹配,此尝试在工厂失败-> CreateDevice:
Microsoft::WRL::ComPtr<ID2D1DeviceContext3> devCon3;
Microsoft::WRL::ComPtr<IDXGIAdapter> dxgiAdapter;
Microsoft::WRL::ComPtr<ID2D1Factory3> factory;
Microsoft::WRL::ComPtr<IDXGIFactory> dxgiFactory;
Microsoft::WRL::ComPtr<IDXGIDevice> dxgiDevice;
Microsoft::WRL::ComPtr<ID3D11Device> dev;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> devCon;
Microsoft::WRL::ComPtr<ID2D1Device3> dev3d;
D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, 0, createDeviceFlags, NULL, 0, D3D11_SDK_VERSION, &dev, &featureLevel, &devCon);
Hres = dev.As(&dxgiDevice);
Hres = dxgiDevice->GetAdapter(dxgiAdapter.GetAddressOf());
Hres = dxgiAdapter->GetParent(__uuidof(IDXGIFactory), &dxgiFactory);
Hres = dxgiFactory->CreateSwapChain(dev.Get(), &scd, swapChain.GetAddressOf());
Hres = (D2D1CreateFactory(D2D1_FACTORY_TYPE_MULTI_THREADED, __uuidof(ID2D1Factory3), &options, &factory));
Hres = (dev3d.Get()->QueryInterface(__uuidof(IDXGIDevice), &dxgiDevice));
Hres = factory->CreateDevice(dxgiDevice.Get(), &dev3d) ;
Hres = dev3d->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS, &devCon3);