Bjoern Graf:One thing that could be a problem here is the "To work with Direct2D, the Direct3D device that provides the IDXGISurface must be created with the D3D10_CREATE_DEVICE_BGRA_SUPPORT flag." (from
ID2D1Factory::CreateDxgiSurfaceRenderTarget Overloaded Method) requirement (E_NOINTERFACE seems to be a weird error in that case, though). Of what type if
renderTarget?
Side note: from the looks of it DXGI surfaces seem to be (more or less) D3D version agnostic so it shouldn't matter if it's D3D10.1 or 11 (D2D needs access to the surface bits only which the IDXGISurface interface provides).
The D3D11 device was created with flag D3D11_CREATE_DEVICE_BGRA_SUPPORT.
The render target:
D3D11_TEXTURE2D_DESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.Width = width;
desc.Height = height;
desc.MipLevels = 1;
desc.ArraySize = 1;
desc.Format =
DXGI_FORMAT_B8G8R8A8_UNORM;
desc.SampleDesc.Count = 1;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
desc.MiscFlags = 0;
Do you have working sample D3D11+D2D?